From d12917d0e7f8f89a0ac2ec678cf21a26e95eb382 Mon Sep 17 00:00:00 2001 From: Erik Reid <erik.reid@geant.org> Date: Tue, 5 Feb 2019 08:59:58 +0100 Subject: [PATCH] added pass criteria for juniper hostname derivation --- test/test_junosspace_io.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/test_junosspace_io.py b/test/test_junosspace_io.py index eb910fc4..49d40c7b 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) -- GitLab