def testGetTemplate(self, run_mock): Config._drop() configService = Config("/fake/path") template = configService.getTemplate("mysql.yml") targetTemplate = "my mysql fake sample" self.assertEqual(template, targetTemplate) configService = Config() template = configService.getTemplate("mysql.yml") self.assertEqual(template, targetTemplate)
def testGetSettings(self, run_mock): Config._drop() configService = Config("/fake/path") settings = configService.getSettings() targetSettings = {'rancher.host': "test", 'rancher.port': 1234} self.assertEqual(settings, targetSettings) configService = Config() settings = configService.getSettings() self.assertEqual(settings, targetSettings)
def testGetIndex(self, run_mock): Config._drop() configService = Config("/fake/path") index = configService.getIndex() targetIndex = { 'mysql': { 'image': 'fake/image', 'command': 'facke command' } } self.assertEqual(index, targetIndex) configService = Config() index = configService.getIndex() self.assertEqual(index, targetIndex)
def tearDown(self): Config._drop()