Exemplo n.º 1
0
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')
Exemplo n.º 2
0
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')
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
    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')