class TestConfig(unittest.TestCase): def setUp(self): with open(test_path + 'config.json', 'w') as handler: handler.write(CONFIG_FILE_CONTENT) self.config = Config() self.config.load(test_path + 'config.json') def tearDown(self): try: os.remove(test_path + 'config.json') except: pass def test_get(self): prefix = self.config.get('prefix_path') self.assertEqual(prefix['lib'], '../../../lib/') def test_set(self): self.config.set('name', 'dexbol') self.assertEqual(self.config.get('name'), 'dexbol')
def setUp(self): with open(test_path + 'config.json', 'w') as handler: handler.write(CONFIG_FILE_CONTENT) self.config = Config() self.config.load(test_path + 'config.json')