예제 #1
0
    def test_libraries(self):
        kastore_lib = {"version": ".".join(map(str, _tskit.get_kastore_version()))}
        env = provenance.get_environment()
        assert {"kastore": kastore_lib, "tskit": {"version": tskit.__version__}} == env[
            "libraries"
        ]

        env = provenance.get_environment(include_tskit=False)
        assert {"kastore": kastore_lib} == env["libraries"]

        extra_libs = {"abc": [], "xyz": {"one": 1}}
        env = provenance.get_environment(include_tskit=False, extra_libs=extra_libs)
        libs = {"kastore": kastore_lib}
        libs.update(extra_libs)
        assert libs == env["libraries"]
예제 #2
0
 def test_python(self):
     env = provenance.get_environment()
     python = {
         "implementation": platform.python_implementation(),
         "version": platform.python_version(),
     }
     self.assertEqual(env["python"], python)
예제 #3
0
 def test_simplify(self):
     ts = msprime.simulate(5, random_seed=1)
     ts = ts.simplify()
     prov = json.loads(ts.provenance(1).record)
     tskit.validate_provenance(prov)
     assert prov["parameters"]["command"] == "simplify"
     assert prov["environment"] == provenance.get_environment(include_tskit=False)
     assert prov["software"] == {"name": "tskit", "version": tskit.__version__}
예제 #4
0
 def test_os(self):
     env = provenance.get_environment()
     os = {
         "system": platform.system(),
         "node": platform.node(),
         "release": platform.release(),
         "version": platform.version(),
         "machine": platform.machine()
     }
     self.assertEqual(env["os"], os)