Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
 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)
Beispiel #6
0
 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)