vnpy/tests/trader/test_settings.py

26 lines
530 B
Python
Raw Permalink Normal View History

"""
Test if database works fine
"""
import unittest
2019-04-14 10:52:02 +00:00
from vnpy.trader.setting import SETTINGS, get_settings
class TestSettings(unittest.TestCase):
def test_get_settings(self):
SETTINGS['a'] = 1
got = get_settings()
self.assertIn('a', got)
self.assertEqual(got['a'], 1)
def test_get_settings_with_prefix(self):
SETTINGS['a.a'] = 1
got = get_settings()
self.assertIn('a', got)
self.assertEqual(got['a'], 1)
if __name__ == '__main__':
2019-04-14 10:52:02 +00:00
unittest.main()