Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_repr(self):
base_fitter = estimation.BaseFitter()
assert repr(base_fitter) == ''
base_fitter.params_ = dict(x=12.3, y=42)
base_fitter.data = np.array([1, 2, 3])
assert repr(base_fitter) == ''
base_fitter.data = None
assert repr(base_fitter) == ''
def test_save_load_model(self):
base_fitter = estimation.BaseFitter()
base_fitter.save_model(PATH_SAVE_MODEL)
assert os.path.exists(PATH_SAVE_MODEL) == True
base_fitter_saved = estimation.BaseFitter()
base_fitter_saved.load_model(PATH_SAVE_MODEL)
assert repr(base_fitter) == repr(base_fitter_saved)
os.remove(PATH_SAVE_MODEL)
def test_save_load_model(self):
base_fitter = estimation.BaseFitter()
base_fitter.save_model(PATH_SAVE_MODEL)
assert os.path.exists(PATH_SAVE_MODEL) == True
base_fitter_saved = estimation.BaseFitter()
base_fitter_saved.load_model(PATH_SAVE_MODEL)
assert repr(base_fitter) == repr(base_fitter_saved)
os.remove(PATH_SAVE_MODEL)
def test_unload_params(self):
base_fitter = estimation.BaseFitter()
with pytest.raises(ValueError):
base_fitter._unload_params()
base_fitter.params_ = dict(x=12.3, y=42)
npt.assert_array_almost_equal([12.3, 42], base_fitter._unload_params('x', 'y'))