Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 53afc33

Browse files
committed
more tests
1 parent 1c59162 commit 53afc33

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/mljar_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from mljar.client.project import ProjectClient
1111
from project_based_test import ProjectBasedTest
12+
from mljar.exceptions import BadValueException, IncorrectInputDataException
1213
from mljar import Mljar
1314

1415
class MljarTest(ProjectBasedTest):
@@ -50,6 +51,29 @@ def test_basic_usage(self):
5051
score = self.mse(pred, self.y)
5152
self.assertTrue(score < 0.1)
5253

54+
def test_empty_project_title(self):
55+
with self.assertRaises(BadValueException) as context:
56+
model = Mljar(project = '', experiment = '')
57+
58+
def test_wrong_tuning_mode(self):
59+
with self.assertRaises(BadValueException) as context:
60+
model = Mljar(project = self.proj_title, experiment = self.expt_title,
61+
tuning_mode = 'Crazy')
62+
63+
def test_default_tuning_mode(self):
64+
model = Mljar(project = self.proj_title, experiment = self.expt_title)
65+
self.assertEqual(model.tuning_mode, 'Sport')
66+
67+
def test_wrong_input_dim(self):
68+
with self.assertRaises(IncorrectInputDataException) as context:
69+
model = Mljar(project = self.proj_title, experiment = self.expt_title)
70+
samples = 100
71+
columns = 10
72+
X = np.random.rand(samples, columns)
73+
y = np.random.choice([0,1], samples+1, replace = True)
74+
model.fit(X, y)
75+
76+
5377
def test_non_wait_fit(self):
5478
'''
5579
Test the non wait fit.

0 commit comments

Comments
 (0)