def test_read_json(): test.write_json(ALL_HYPERPARAMETERS, _env.hyperparameters_file_dir) assert _files.read_json( _env.hyperparameters_file_dir) == ALL_HYPERPARAMETERS
def test_read_json_throws_exception(): with pytest.raises(IOError): _files.read_json('non-existent.json')
def load(cls, model_dir): clazz = cls() clazz.__dict__ = _files.read_json(model_dir) return clazz