Exemplo n.º 1
0
 def test_round_trip(self):
     with open(os.path.join(this_directory, "example_0.7.json")) as fp:
         data_in = json.load(fp)
     record = serialization.build_record(data_in)
     data_out = json.loads(serialization.encode_record(record, indent=2))
     # tags in records are a set, hence have arbitrary order.
     self.assertTrue("tags" in data_out)
     data_in["tags"] = sorted(data_in["tags"])
     data_out["tags"] = sorted(data_out["tags"])
     self.assertEqual(data_in, data_out)
Exemplo n.º 2
0
 def test_round_trip(self):
     with open(os.path.join(this_directory, "example_0.7.json")) as fp:
         data_in = json.load(fp)
     record = serialization.build_record(data_in)
     data_out = json.loads(serialization.encode_record(record, indent=2))
     # tags in records are a set, hence have arbitrary order.
     self.assertTrue('tags' in data_out)
     data_in['tags'] = sorted(data_in['tags'])
     data_out['tags'] = sorted(data_out['tags'])
     self.assertEqual(data_in, data_out)
Exemplo n.º 3
0
 def test_build_record_v0p6(self):
     with open(os.path.join(this_directory, "example_0.6.json")) as fp:
         record = serialization.build_record(json.load(fp))
     self.assertEqual(record.label, "haggling")
Exemplo n.º 4
0
 def test_build_record_v0p6(self):
     with open(os.path.join(this_directory, "example_0.6.json")) as fp:
         record = serialization.build_record(json.load(fp))
     self.assertEqual(record.label, "haggling")
Exemplo n.º 5
0
 def test_round_trip(self):
     with open("example_0.6.json") as fp:
         data_in = json.load(fp)
     record = serialization.build_record(data_in)
     data_out = json.loads(serialization.encode_record(record, indent=2))
     self.assertEqual(data_in, data_out)
Exemplo n.º 6
0
 def test_build_record_v0p5(self):
     with open("example_0.5.json") as fp:
         record = serialization.build_record(json.load(fp))
     self.assertEqual(record.label, "haggling")
Exemplo n.º 7
0
 def test_round_trip(self):
     with open("example_0.6.json") as fp:
         data_in = json.load(fp)
     record = serialization.build_record(data_in)
     data_out = json.loads(serialization.encode_record(record, indent=2))
     self.assertEqual(data_in, data_out)
Exemplo n.º 8
0
 def test_build_record_v0p5(self):
     with open("example_0.5.json") as fp:
         record = serialization.build_record(json.load(fp))
     self.assertEqual(record.label, "haggling")