Newer
Older
CONTEXT_WITH_SERVICE = copy.deepcopy(CONTEXT)
CONTEXT_WITH_SERVICE['service_ids'].append(SERVICE_R1_R3_ID)
response = context_client_grpc.SetContext(Context(**CONTEXT_WITH_SERVICE))
assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID
events = events_collector.get_events(block=True, count=11)
assert isinstance(events[0], ContextEvent)
assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert events[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert isinstance(events[1], TopologyEvent)
assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID
assert isinstance(events[2], DeviceEvent)
assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert events[2].device_id.device_uuid.uuid == DEVICE_R1_UUID
assert isinstance(events[3], DeviceEvent)
assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert events[3].device_id.device_uuid.uuid == DEVICE_R2_UUID
assert isinstance(events[4], DeviceEvent)
assert events[4].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert events[4].device_id.device_uuid.uuid == DEVICE_R3_UUID
assert isinstance(events[5], ServiceEvent)
assert events[5].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert events[5].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert events[5].service_id.service_uuid.uuid == SERVICE_R1_R2_UUID
assert isinstance(events[6], ContextEvent)
assert events[6].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE
assert events[6].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert isinstance(events[7], ServiceEvent)
assert events[7].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert events[7].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert events[7].service_id.service_uuid.uuid == SERVICE_R2_R3_UUID
assert isinstance(events[8], ContextEvent)
assert events[8].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE
assert events[8].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert isinstance(events[9], ServiceEvent)
assert events[9].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert events[9].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert events[9].service_id.service_uuid.uuid == SERVICE_R1_R3_UUID
assert isinstance(events[10], ContextEvent)
assert events[10].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE
assert events[10].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
# ----- Get when the object does not exist -------------------------------------------------------------------------
with pytest.raises(grpc.RpcError) as e:
context_client_grpc.GetConnection(ConnectionId(**CONNECTION_R1_R3_ID))
assert e.value.code() == grpc.StatusCode.NOT_FOUND
assert e.value.details() == 'Connection({:s}) not found'.format(CONNECTION_R1_R3_UUID)
# ----- List when the object does not exist ------------------------------------------------------------------------
response = context_client_grpc.ListConnectionIds(ServiceId(**SERVICE_R1_R3_ID))
assert len(response.connection_ids) == 0
response = context_client_grpc.ListConnections(ServiceId(**SERVICE_R1_R3_ID))
assert len(response.connections) == 0
# ----- Dump state of database before create the object ------------------------------------------------------------
db_entries = context_database.dump()
LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries)))
for db_entry in db_entries:
LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover
LOGGER.info('-----------------------------------------------------------')
# ----- Create the object ------------------------------------------------------------------------------------------
with pytest.raises(grpc.RpcError) as e:
WRONG_CONNECTION = copy.deepcopy(CONNECTION_R1_R3)
WRONG_CONNECTION['path_hops_endpoint_ids'][0]\
['topology_id']['context_id']['context_uuid']['uuid'] = 'wrong-context-uuid'
context_client_grpc.SetConnection(Connection(**WRONG_CONNECTION))
assert e.value.code() == grpc.StatusCode.NOT_FOUND
# TODO: should we check that all endpoints belong to same topology?
# TODO: should we check that endpoints form links over the topology?
msg = 'EndPoint({:s}/{:s}:wrong-context-uuid/{:s}) not found'.format(
DEVICE_R1_UUID, WRONG_CONNECTION['path_hops_endpoint_ids'][0]['endpoint_uuid']['uuid'], DEFAULT_TOPOLOGY_UUID)
assert e.value.details() == msg
response = context_client_grpc.SetConnection(Connection(**CONNECTION_R1_R3))
assert response.connection_uuid.uuid == CONNECTION_R1_R3_UUID
# ----- Check create event -----------------------------------------------------------------------------------------
event = events_collector.get_event(block=True)
assert isinstance(event, ConnectionEvent)
assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE
assert event.connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID
# ----- Update the object ------------------------------------------------------------------------------------------
response = context_client_grpc.SetConnection(Connection(**CONNECTION_R1_R3))
assert response.connection_uuid.uuid == CONNECTION_R1_R3_UUID
# ----- Check update event -----------------------------------------------------------------------------------------
event = events_collector.get_event(block=True)
assert isinstance(event, ConnectionEvent)
assert event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE
assert event.connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID
# ----- Dump state of database after create/update the object ------------------------------------------------------
db_entries = context_database.dump()
LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries)))
for db_entry in db_entries:
LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover
LOGGER.info('-----------------------------------------------------------')
# ----- Get when the object exists ---------------------------------------------------------------------------------
response = context_client_grpc.GetConnection(ConnectionId(**CONNECTION_R1_R3_ID))
assert response.connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID
assert response.service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert response.service_id.service_uuid.uuid == SERVICE_R1_R3_UUID
assert len(response.path_hops_endpoint_ids) == 6
assert len(response.sub_service_ids) == 2
# ----- List when the object exists --------------------------------------------------------------------------------
response = context_client_grpc.ListConnectionIds(ServiceId(**SERVICE_R1_R3_ID))
assert len(response.connection_ids) == 1
assert response.connection_ids[0].connection_uuid.uuid == CONNECTION_R1_R3_UUID
response = context_client_grpc.ListConnections(ServiceId(**SERVICE_R1_R3_ID))
assert len(response.connections) == 1
assert response.connections[0].connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID
assert len(response.connections[0].path_hops_endpoint_ids) == 6
assert len(response.connections[0].sub_service_ids) == 2
# ----- Remove the object ------------------------------------------------------------------------------------------
context_client_grpc.RemoveConnection(ConnectionId(**CONNECTION_R1_R3_ID))
context_client_grpc.RemoveService(ServiceId(**SERVICE_R1_R3_ID))
context_client_grpc.RemoveService(ServiceId(**SERVICE_R2_R3_ID))
context_client_grpc.RemoveService(ServiceId(**SERVICE_R1_R2_ID))
context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R1_ID))
context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R2_ID))
context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R3_ID))
context_client_grpc.RemoveTopology(TopologyId(**TOPOLOGY_ID))
context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID))
# ----- Check remove event -----------------------------------------------------------------------------------------
events = events_collector.get_events(block=True, count=9)
assert isinstance(events[0], ConnectionEvent)
assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[0].connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID
assert isinstance(events[1], ServiceEvent)
assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[1].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert events[1].service_id.service_uuid.uuid == SERVICE_R1_R3_UUID
assert isinstance(events[2], ServiceEvent)
assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[2].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert events[2].service_id.service_uuid.uuid == SERVICE_R2_R3_UUID
assert isinstance(events[3], ServiceEvent)
assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[3].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert events[3].service_id.service_uuid.uuid == SERVICE_R1_R2_UUID
assert isinstance(events[4], DeviceEvent)
assert events[4].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[4].device_id.device_uuid.uuid == DEVICE_R1_UUID
assert isinstance(events[5], DeviceEvent)
assert events[5].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[5].device_id.device_uuid.uuid == DEVICE_R2_UUID
assert isinstance(events[6], DeviceEvent)
assert events[6].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[6].device_id.device_uuid.uuid == DEVICE_R3_UUID
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
assert isinstance(events[7], TopologyEvent)
assert events[7].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[7].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
assert events[7].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID
assert isinstance(events[8], ContextEvent)
assert events[8].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
assert events[8].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID
# ----- Stop the EventsCollector -----------------------------------------------------------------------------------
events_collector.stop()
# ----- Dump state of database after remove the object -------------------------------------------------------------
db_entries = context_database.dump()
LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries)))
for db_entry in db_entries:
LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover
LOGGER.info('-----------------------------------------------------------')
assert len(db_entries) == 0
def test_grpc_policy(
context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name
context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name
context_database = context_db_mb[0]
# ----- Clean the database -----------------------------------------------------------------------------------------
context_database.clear_all()
# ----- Initialize the EventsCollector -----------------------------------------------------------------------------
#events_collector = EventsCollector(context_client_grpc)
#events_collector.start()
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
# ----- Get when the object does not exist -------------------------------------------------------------------------
POLICY_ID = 'no-uuid'
DEFAULT_POLICY_ID = {'uuid': {'uuid': POLICY_ID}}
with pytest.raises(grpc.RpcError) as e:
context_client_grpc.GetPolicyRule(PolicyRuleId(**DEFAULT_POLICY_ID))
assert e.value.code() == grpc.StatusCode.NOT_FOUND
assert e.value.details() == 'PolicyRule({:s}) not found'.format(POLICY_ID)
# ----- List when the object does not exist ------------------------------------------------------------------------
response = context_client_grpc.ListPolicyRuleIds(Empty())
assert len(response.policyRuleIdList) == 0
response = context_client_grpc.ListPolicyRules(Empty())
assert len(response.policyRules) == 0
# ----- Dump state of database before create the object ------------------------------------------------------------
db_entries = context_database.dump()
LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries)))
for db_entry in db_entries:
LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover
LOGGER.info('-----------------------------------------------------------')
assert len(db_entries) == 0
# ----- Create the object ------------------------------------------------------------------------------------------
response = context_client_grpc.SetPolicyRule(PolicyRule(**POLICY_RULE))
assert response.uuid.uuid == POLICY_RULE_UUID
# ----- Check create event -----------------------------------------------------------------------------------------
# events = events_collector.get_events(block=True, count=1)
# assert isinstance(events[0], PolicyEvent)
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
# assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE
# assert events[0].policy_id.uuid.uuid == POLICY_RULE_UUID
# ----- Update the object ------------------------------------------------------------------------------------------
response = context_client_grpc.SetPolicyRule(PolicyRule(**POLICY_RULE))
assert response.uuid.uuid == POLICY_RULE_UUID
# ----- Dump state of database after create/update the object ------------------------------------------------------
db_entries = context_database.dump()
LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries)))
for db_entry in db_entries:
LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover
LOGGER.info('-----------------------------------------------------------')
assert len(db_entries) == 2
# ----- Get when the object exists ---------------------------------------------------------------------------------
response = context_client_grpc.GetPolicyRule(PolicyRuleId(**POLICY_RULE_ID))
assert response.device.policyRuleBasic.policyRuleId.uuid.uuid == POLICY_RULE_UUID
# ----- List when the object exists --------------------------------------------------------------------------------
response = context_client_grpc.ListPolicyRuleIds(Empty())
assert len(response.policyRuleIdList) == 1
assert response.policyRuleIdList[0].uuid.uuid == POLICY_RULE_UUID
response = context_client_grpc.ListPolicyRules(Empty())
assert len(response.policyRules) == 1
# ----- Remove the object ------------------------------------------------------------------------------------------
context_client_grpc.RemovePolicyRule(PolicyRuleId(**POLICY_RULE_ID))
# ----- Check remove event -----------------------------------------------------------------------------------------
# events = events_collector.get_events(block=True, count=2)
# assert isinstance(events[0], PolicyEvent)
# assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE
# assert events[0].policy_id.uuid.uuid == POLICY_RULE_UUID
# ----- Stop the EventsCollector -----------------------------------------------------------------------------------
# events_collector.stop()
# ----- Dump state of database after remove the object -------------------------------------------------------------
db_entries = context_database.dump()
LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries)))
for db_entry in db_entries:
LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover
LOGGER.info('-----------------------------------------------------------')
assert len(db_entries) == 0
# ----- Test REST API methods ------------------------------------------------------------------------------------------
def test_rest_populate_database(
context_db_mb : Tuple[Database, MessageBroker], # pylint: disable=redefined-outer-name
context_service_grpc : ContextService # pylint: disable=redefined-outer-name
):
database = context_db_mb[0]
database.clear_all()
def test_rest_get_context_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
reply = do_rest_request('/context_ids')
validate_context_ids(reply)
def test_rest_get_contexts(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
reply = do_rest_request('/contexts')
validate_contexts(reply)
def test_rest_get_context(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
reply = do_rest_request('/context/{:s}'.format(context_uuid))
validate_context(reply)
def test_rest_get_topology_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
reply = do_rest_request('/context/{:s}/topology_ids'.format(context_uuid))
validate_topology_ids(reply)
def test_rest_get_topologies(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
reply = do_rest_request('/context/{:s}/topologies'.format(context_uuid))
validate_topologies(reply)
def test_rest_get_topology(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
topology_uuid = urllib.parse.quote(DEFAULT_TOPOLOGY_UUID)
reply = do_rest_request('/context/{:s}/topology/{:s}'.format(context_uuid, topology_uuid))
validate_topology(reply, num_devices=3, num_links=3)
def test_rest_get_service_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
reply = do_rest_request('/context/{:s}/service_ids'.format(context_uuid))
validate_service_ids(reply)
def test_rest_get_services(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
reply = do_rest_request('/context/{:s}/services'.format(context_uuid))
validate_services(reply)
def test_rest_get_service(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
service_uuid = urllib.parse.quote(SERVICE_R1_R2_UUID, safe='')
reply = do_rest_request('/context/{:s}/service/{:s}'.format(context_uuid, service_uuid))
validate_service(reply)
def test_rest_get_slice_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
reply = do_rest_request('/context/{:s}/slice_ids'.format(context_uuid))
#validate_slice_ids(reply)
def test_rest_get_slices(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
reply = do_rest_request('/context/{:s}/slices'.format(context_uuid))
#validate_slices(reply)
#def test_rest_get_slice(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
# context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
# slice_uuid = urllib.parse.quote(SLICE_R1_R2_UUID, safe='')
# reply = do_rest_request('/context/{:s}/slice/{:s}'.format(context_uuid, slice_uuid))
# #validate_slice(reply)
def test_rest_get_device_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
reply = do_rest_request('/device_ids')
validate_device_ids(reply)
def test_rest_get_devices(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
reply = do_rest_request('/devices')
validate_devices(reply)
def test_rest_get_device(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
device_uuid = urllib.parse.quote(DEVICE_R1_UUID, safe='')
reply = do_rest_request('/device/{:s}'.format(device_uuid))
validate_device(reply)
def test_rest_get_link_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
reply = do_rest_request('/link_ids')
validate_link_ids(reply)
def test_rest_get_links(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
reply = do_rest_request('/links')
validate_links(reply)
def test_rest_get_link(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
link_uuid = urllib.parse.quote(LINK_R1_R2_UUID, safe='')
reply = do_rest_request('/link/{:s}'.format(link_uuid))
validate_link(reply)
def test_rest_get_connection_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
service_uuid = urllib.parse.quote(SERVICE_R1_R3_UUID, safe='')
reply = do_rest_request('/context/{:s}/service/{:s}/connection_ids'.format(context_uuid, service_uuid))
validate_connection_ids(reply)
def test_rest_get_connections(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID)
service_uuid = urllib.parse.quote(SERVICE_R1_R3_UUID, safe='')
reply = do_rest_request('/context/{:s}/service/{:s}/connections'.format(context_uuid, service_uuid))
validate_connections(reply)
def test_rest_get_connection(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
connection_uuid = urllib.parse.quote(CONNECTION_R1_R3_UUID, safe='')
reply = do_rest_request('/connection/{:s}'.format(connection_uuid))
validate_connection(reply)
def test_rest_get_policyrule_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
reply = do_rest_request('/policyrule_ids')
#validate_policyrule_ids(reply)
def test_rest_get_policyrules(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
reply = do_rest_request('/policyrules')
#validate_policyrules(reply)
#def test_rest_get_policyrule(context_service_rest : RestServer): # pylint: disable=redefined-outer-name
# policyrule_uuid = urllib.parse.quote(POLICYRULE_UUID, safe='')
# reply = do_rest_request('/policyrule/{:s}'.format(policyrule_uuid))
# #validate_policyrule(reply)
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
# ----- Test misc. Context internal tools ------------------------------------------------------------------------------
def test_tools_fast_string_hasher():
with pytest.raises(TypeError) as e:
fast_hasher(27)
assert str(e.value) == "data(27) must be " + FASTHASHER_DATA_ACCEPTED_FORMAT + ", found <class 'int'>"
with pytest.raises(TypeError) as e:
fast_hasher({27})
assert str(e.value) == "data({27}) must be " + FASTHASHER_DATA_ACCEPTED_FORMAT + ", found <class 'set'>"
with pytest.raises(TypeError) as e:
fast_hasher({'27'})
assert str(e.value) == "data({'27'}) must be " + FASTHASHER_DATA_ACCEPTED_FORMAT + ", found <class 'set'>"
with pytest.raises(TypeError) as e:
fast_hasher([27])
assert str(e.value) == "data[0](27) must be " + FASTHASHER_ITEM_ACCEPTED_FORMAT + ", found <class 'int'>"
fast_hasher('hello-world')
fast_hasher('hello-world'.encode('UTF-8'))
fast_hasher(['hello', 'world'])
fast_hasher(('hello', 'world'))
fast_hasher(['hello'.encode('UTF-8'), 'world'.encode('UTF-8')])
fast_hasher(('hello'.encode('UTF-8'), 'world'.encode('UTF-8')))