Exemplo n.º 1
0
 def test_caching(self):
     n = 10
     schemas = [provenance.get_schema() for _ in range(n)]
     # Ensure all the schemas are different objects.
     self.assertEqual(len(set(map(id, schemas))), n)
     # Ensure the schemas are all equal
     for j in range(n):
         self.assertEqual(schemas[0], schemas[j])
Exemplo n.º 2
0
 def test_caching(self):
     n = 10
     schemas = [provenance.get_schema() for _ in range(n)]
     # Ensure all the schemas are different objects.
     assert len(set(map(id, schemas))) == n
     # Ensure the schemas are all equal
     for j in range(n):
         assert schemas[0] == schemas[j]
Exemplo n.º 3
0
 def test_form(self):
     s = provenance.get_schema()
     self.assertEqual(s["schema"],
                      "http://json-schema.org/draft-07/schema#")
     self.assertEqual(s["version"], "1.0.0")
Exemplo n.º 4
0
 def test_file_equal(self):
     s1 = provenance.get_schema()
     base = os.path.join(os.path.dirname(__file__), "..", "tskit")
     with open(os.path.join(base, "provenance.schema.json")) as f:
         s2 = json.load(f)
     self.assertEqual(s1, s2)
Exemplo n.º 5
0
 def test_form(self):
     s = provenance.get_schema()
     assert s["schema"] == "http://json-schema.org/draft-07/schema#"
     assert s["version"] == "1.0.0"