示例#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)
示例#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)
示例#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)
示例#4
0
文件: test_utils.py 项目: dron1/lago
 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)
示例#5
0
文件: test_utils.py 项目: dron1/lago
 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)
示例#6
0
文件: test_utils.py 项目: dron1/lago
 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)