Ejemplo n.º 1
0
 def test_not_dumpable(self, empty_registry, experiment_data):
     registries = RegistryContainer(empty_registry)
     with pytest.raises(TypeError) as excinfo:
         registries._obj_to_h5preserve(experiment_data)
     assert (
         "<class 'conftest.Experiment'> is not something that can be dumped."
         == str(excinfo.value))
Ejemplo n.º 2
0
 def test_invalid_dumper(self, invalid_dumper_experiment_registry,
                         experiment_data):
     registries = RegistryContainer(invalid_dumper_experiment_registry)
     with pytest.raises(TypeError) as excinfo:
         registries._obj_to_h5preserve(experiment_data)
     assert ("Dumper for Experiment with version 1 returned incorrect type."
             == str(excinfo.value))
Ejemplo n.º 3
0
 def test_no_version(self, experiment_registry, experiment_data):
     registries = RegistryContainer(experiment_registry)
     registries.lock_version(type(experiment_data), 10)
     with pytest.raises(RuntimeError) as excinfo:
         registries._obj_to_h5preserve(experiment_data)
     assert (
         "<class 'conftest.Experiment'> does not have version 10." == str(
             excinfo.value))
Ejemplo n.º 4
0
 def test_invalid_dumper(self, invalid_dumper_experiment_registry, experiment_data):
     registries = RegistryContainer(invalid_dumper_experiment_registry)
     with pytest.raises(TypeError) as excinfo:
         registries._obj_to_h5preserve(experiment_data)
     assert "Dumper for Experiment with version 1 returned incorrect type." == str(excinfo.value)
Ejemplo n.º 5
0
 def test_none(self, None_version_experiment_registry, experiment_data):
     registries = RegistryContainer(None_version_experiment_registry)
     assert registries._obj_to_h5preserve(experiment_data)._version == None
Ejemplo n.º 6
0
 def test_version(self, experiment_registry, experiment_data):
     registries = RegistryContainer(experiment_registry)
     registries.lock_version(type(experiment_data), 1)
     assert registries._obj_to_h5preserve(experiment_data)._version == 1
Ejemplo n.º 7
0
 def test_no_version(self, experiment_registry, experiment_data):
     registries = RegistryContainer(experiment_registry)
     registries.lock_version(type(experiment_data), 10)
     with pytest.raises(RuntimeError) as excinfo:
         registries._obj_to_h5preserve(experiment_data)
     assert "<class 'conftest.Experiment'> does not have version 10." == str(excinfo.value)
Ejemplo n.º 8
0
 def test_not_dumpable(self, empty_registry, experiment_data):
     registries = RegistryContainer(empty_registry)
     with pytest.raises(TypeError) as excinfo:
         registries._obj_to_h5preserve(experiment_data)
     assert "<class 'conftest.Experiment'> is not something that can be dumped." == str(excinfo.value)
Ejemplo n.º 9
0
 def test_none(self, None_version_experiment_registry, experiment_data):
     registries = RegistryContainer(None_version_experiment_registry)
     assert registries._obj_to_h5preserve(experiment_data)._version == None
Ejemplo n.º 10
0
 def test_version(self, experiment_registry, experiment_data):
     registries = RegistryContainer(experiment_registry)
     registries.lock_version(type(experiment_data), 1)
     assert registries._obj_to_h5preserve(experiment_data)._version == 1