예제 #1
0
def test_read_json():
    test.write_json(ALL_HYPERPARAMETERS, _env.hyperparameters_file_dir)

    assert _files.read_json(
        _env.hyperparameters_file_dir) == ALL_HYPERPARAMETERS
예제 #2
0
def test_read_json_throws_exception():
    with pytest.raises(IOError):
        _files.read_json('non-existent.json')
예제 #3
0
 def load(cls, model_dir):
     clazz = cls()
     clazz.__dict__ = _files.read_json(model_dir)
     return clazz