mirror of
https://github.com/bspeice/metrik
synced 2024-11-05 06:58:12 -05:00
529375e10b
I have destroyed a good bit of data so far because unit tests (correctly) dropped databases when they were done, but the config told it to drop the live database (incorrectly)
20 lines
610 B
Python
20 lines
610 B
Python
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):
|
|
config = get_config()
|
|
self.assertEqual(config.get('metrik', 'mongo_database'), 'metrik')
|
|
|
|
config = get_config(is_test=False)
|
|
self.assertEqual(config.get('metrik', 'mongo_database'), 'metrik')
|
|
|
|
config = get_config(is_test=True)
|
|
self.assertEqual(config.get('metrik', 'mongo_database'), 'metrik-test') |