def test_fallback_to_yaml(self): bad_json = StringIO("{'one': 1,}") expected = {'one': 1} loaded_conf = utils.load_virt_stream(virt_fd=bad_json) assert deep_compare(expected, loaded_conf)
def test_load_json(self): json_fd = StringIO(json.dumps(self.virt_conf)) loaded_conf = utils.load_virt_stream(virt_fd=json_fd) assert deep_compare(self.virt_conf, loaded_conf)
def test_load_yaml(self): yaml_fd = StringIO(yaml.dump(self.virt_conf)) loaded_conf = utils.load_virt_stream(virt_fd=yaml_fd) assert deep_compare(self.virt_conf, loaded_conf)