config_test.py 657 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python
  2. # -*- coding:utf-8 -*-
  3. import unittest
  4. import config
  5. class ConfigTest(unittest.TestCase):
  6. def test_read_local_config(self):
  7. path = 'config.json'
  8. conf = config.Config(path)
  9. local_config = conf.read_local_config()
  10. self.assertIsNotNone(local_config)
  11. self.assertEqual(local_config['redis_host'], 'local.pc')
  12. self.assertEqual(local_config['redis_port'], ':6370')
  13. self.assertEqual(local_config['redis_db'], 1)
  14. self.assertEqual(local_config['redis_password'], 'password')
  15. def test_read_redis_config(self):
  16. pass
  17. if __name__ == '__main__':
  18. unittest.main()