def test_read_file_no_deserialize(self): test_plan = {'tests': ['test1', 'test2'], 'bundle': 'bundle-url'} content = yaml.dump(test_plan) with NamedTemporaryFile(suffix=".yaml") as yaml_file: yaml_file.write(content) yaml_file.flush() output = read_file(yaml_file.name) self.assertEqual(output, 'bundle: bundle-url\ntests: [test1, test2]\n')
def test_read_file(self): test_plan = {'tests': ['test1', 'test2'], 'bundle': 'bundle-url'} content = yaml.dump(test_plan) with NamedTemporaryFile(suffix=".yaml") as yaml_file: yaml_file.write(content) yaml_file.flush() output = read_file(yaml_file.name, file_type='yaml') self.assertEqual(output, yaml.load(content))