1
0
mirror of https://github.com/bspeice/metrik synced 2024-11-23 07:38:09 -05:00
metrik/test/test_conf.py

22 lines
786 B
Python
Raw Permalink Normal View History

from unittest import TestCase
from metrik.conf import get_config
class ConfigurationTest(TestCase):
def test_config_returns_values(self):
config = get_config([])
assert config is not None
def test_config_manual_test_instruction(self):
2016-08-30 09:26:16 -04:00
# This assertion will fail if you're not using pytest or running on Travis
config = get_config()
2016-08-30 09:26:16 -04:00
self.assertEqual(config.get('metrik', 'mongo_database'), 'metrik-test')
2016-08-30 08:53:23 -04:00
# This assertion will fail if you're not using pytest or running on Travis
config = get_config(is_test=False)
2016-08-30 08:53:23 -04:00
self.assertEqual(config.get('metrik', 'mongo_database'), 'metrik-test')
config = get_config(is_test=True)
self.assertEqual(config.get('metrik', 'mongo_database'), 'metrik-test')