From 3f161d14ed1844ee9c189961eab9c15ea46b3573 Mon Sep 17 00:00:00 2001 From: Denis Zheleztsov Date: Mon, 14 Nov 2016 15:59:39 +0300 Subject: [PATCH] tests progress --- build/tests.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build/tests.py b/build/tests.py index 6a06c5f..ece5c7b 100644 --- a/build/tests.py +++ b/build/tests.py @@ -45,5 +45,27 @@ class TestLogger(unittest.TestCase): self.assertIn('DEBUG', m({'level': 'DEBUG', 'raw': 'log message'})) +class TestMemcachedDiscovery(unittest.TestCase): + + def test_discovery_memcache(self): + from surok.system import discovery_memcached + + # Load base configurations + surok_conf = '/etc/surok/conf/surok.json' + # Read config file + f = open(surok_conf, 'r') + conf = json.loads(f.read()) + f.close() + + self.assertEqual(discovery_memcached(conf), []) + + +class TestGetGroup(unittest.TestCase): + + def test_get_group(self): + from surok.discovery import get_group + self.assertFalse(get_group({}, {'env': os.environ})) + + if __name__ == '__main__': unittest.main()