Skip to content
Snippets Groups Projects
Commit be63ba2c authored by lukas leufen's avatar lukas leufen
Browse files

corrected tests, /close #25

parent caf82558
No related branches found
No related tags found
3 merge requests!17update to v0.4.0,!15new feat split subsets,!13fix bug make tests running
Pipeline #26128 passed
...@@ -19,7 +19,7 @@ class TestToList: ...@@ -19,7 +19,7 @@ class TestToList:
class TestCheckPath: class TestCheckPath:
def test_check_path_and_create(self, caplog): def test_check_path_and_create(self, caplog):
caplog.set_level(logging.INFO) caplog.set_level(logging.DEBUG)
path = 'data/test' path = 'data/test'
assert not os.path.exists('data/test') assert not os.path.exists('data/test')
check_path_and_create(path) check_path_and_create(path)
...@@ -152,7 +152,7 @@ class TestPrepareHost: ...@@ -152,7 +152,7 @@ class TestPrepareHost:
@mock.patch("os.path.exists", return_value=True) @mock.patch("os.path.exists", return_value=True)
def test_prepare_host(self, mock_host, mock_user, mock_path): def test_prepare_host(self, mock_host, mock_user, mock_path):
path = prepare_host() path = prepare_host()
assert path == "/home/testUser/machinelearningtools" assert path == "/home/testUser/machinelearningtools/data/toar_daily/"
path = prepare_host() path = prepare_host()
assert path == "/home/testUser/Data/toar_daily/" assert path == "/home/testUser/Data/toar_daily/"
path = prepare_host() path = prepare_host()
...@@ -178,8 +178,8 @@ class TestSetExperimentName: ...@@ -178,8 +178,8 @@ class TestSetExperimentName:
def test_set_experiment(self): def test_set_experiment(self):
exp_name, exp_path = set_experiment_name() exp_name, exp_path = set_experiment_name()
assert exp_name == "" assert exp_name == "TestExperiment"
assert exp_path == os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "")) assert exp_path == os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "TestExperiment"))
exp_name, exp_path = set_experiment_name(experiment_date="2019-11-14", experiment_path="./test2") exp_name, exp_path = set_experiment_name(experiment_date="2019-11-14", experiment_path="./test2")
assert exp_name == "2019-11-14_network/" assert exp_name == "2019-11-14_network/"
assert exp_path == os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "test2")) assert exp_path == os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "test2"))
......
...@@ -7,9 +7,9 @@ from src.statistics import standardise, standardise_inverse, centre, centre_inve ...@@ -7,9 +7,9 @@ from src.statistics import standardise, standardise_inverse, centre, centre_inve
@pytest.fixture(scope='module') @pytest.fixture(scope='module')
def input_data(): def input_data():
return np.array([np.random.normal(2, 2, 2000), return np.array([np.random.normal(2, 2, 3000),
np.random.normal(-5, 3, 2000), np.random.normal(-5, 3, 3000),
np.random.normal(10, 1, 2000)]).T np.random.normal(10, 1, 3000)]).T
@pytest.fixture(scope='module') @pytest.fixture(scope='module')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment