diff --git a/test/test_junosspace_io.py b/test/test_junosspace_io.py index eb910fc496b086d4de3d44128e06e651f0e9e717..49d40c7bc2add6fe455a29ac43e927ac1d196129 100644 --- a/test/test_junosspace_io.py +++ b/test/test_junosspace_io.py @@ -35,11 +35,20 @@ def test_junosspace_devices_parsing(data_config): def test_router_hostname_derivation(mocked_redis): + """ + test result depends specifically on the test data set containing + a realistic snapshot + + :param mocked_redis: + :return: + """ config = { 'redis': { 'hostname': None, 'port': None } } - for hostname in worker._derive_router_hostnames(config): - assert re.match('^mx[\d].+\.geant\.net$', hostname) + hostnames = list(worker._derive_router_hostnames(config)) + assert hostnames # test data is non-empty + for h in hostnames: + assert re.match(r'^mx[12].+\.geant\.net$', h)