Пример #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))
Пример #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))
Пример #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))
Пример #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)
Пример #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
Пример #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
Пример #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)
Пример #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)
Пример #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
Пример #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