def test_load_without_app_files(self): config = load_config() expected = { 'pre-restart': [], 'post-restart': [], } self.assertDictEqual(config, expected)
def test_load_app_yml(self): with open("app.yml", "w") as f: f.write(self.data) config = load_config() expected = { 'hooks': None, 'pre-restart': ['testdata/pre.sh'], 'post-restart': ['testdata/pos.sh'], } self.assertDictEqual(config, expected) os.remove("app.yml")
def test_load_app_yml(self): yml_file = os.path.join(self.working_dir, "app.yaml") with open(yml_file, "w") as f: f.write(self.data) config = load_config(watcher=self.watcher) expected = { 'hooks': { 'pre-restart': ['testdata/pre.sh'], 'post-restart': ['testdata/pos.sh'], } } self.assertDictEqual(config, expected) os.remove(yml_file)
def test_load_without_app_files(self): config = load_config(watcher=self.watcher) expected = {} self.assertDictEqual(config, expected)