vnpy/tests/trader/test_settings.py
nanoric 5d0bf006c6 [Add] added support for mongodb
[Add] added tests for database and CsvLoaderEngine
[Mod] changed .travis.yaml
2019-04-14 06:15:06 -04:00

24 lines
528 B
Python

"""
Test if database works fine
"""
import unittest
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__':
unittest.main()