Skip to content

Commit 985ec32

Browse files
committed
Add test for featurizing unlabeled data
1 parent b7a5888 commit 985ec32

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
filename
2+
217801
3+
224635

cesium_app/tests/fixtures.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,21 @@ def create_test_dataset(project, label_type='class'):
3636
------
3737
project : `models.Project` instance
3838
The project under which to create test dataset.
39-
label_type : str
40-
String indicating whether data labels are class names ('class')
41-
for classification, or numerical values for regression (anything other
42-
than 'class'). Defaults to 'class'.
43-
39+
label_type : str, optional
40+
String indicating whether data labels are class names for
41+
classification ('class'), numerical values for regression ('regr'),
42+
or no labels (anything else).
43+
Defaults to 'class'.
4444
"""
4545
if label_type == 'class':
4646
header = pjoin(os.path.dirname(__file__),
4747
'data', 'asas_training_subset_classes.dat')
4848
elif label_type == 'regr':
4949
header = pjoin(os.path.dirname(__file__),
5050
'data', 'asas_training_subset_targets.dat')
51+
else:
52+
header = pjoin(os.path.dirname(__file__),
53+
'data', 'asas_training_subset_unlabeled.dat')
5154
tarball = pjoin(os.path.dirname(__file__),
5255
'data', 'asas_training_subset.tar.gz')
5356
header = shutil.copy2(header, cfg['paths']['upload_folder'])

cesium_app/tests/frontend/test_features.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,30 @@ def test_add_new_featureset(driver):
3737
status_td = driver.find_element_by_xpath("//td[contains(text(),'Completed')]")
3838

3939

40+
def test_featurize_unlabeled(driver):
41+
driver.get('/')
42+
with create_test_project() as p, create_test_dataset(p, label_type=None) as ds:
43+
driver.refresh()
44+
proj_select = Select(driver.find_element_by_css_selector('[name=project]'))
45+
proj_select.select_by_value(str(p.id))
46+
47+
driver.find_element_by_id('react-tabs-4').click()
48+
driver.find_element_by_partial_link_text('Compute New Features').click()
49+
50+
featureset_name = driver.find_element_by_css_selector('[name=featuresetName]')
51+
featureset_name.send_keys(test_featureset_name)
52+
53+
driver.find_element_by_class_name('btn-primary').click()
54+
55+
driver.implicitly_wait(1)
56+
status_td = driver.find_element_by_xpath(
57+
"//div[contains(text(),'Feature computation begun')]")
58+
status_td = driver.find_element_by_xpath("//td[contains(text(),'In progress')]")
59+
60+
driver.implicitly_wait(30)
61+
status_td = driver.find_element_by_xpath("//td[contains(text(),'Completed')]")
62+
63+
4064
def test_check_uncheck_features(driver):
4165
driver.get('/')
4266
with create_test_project() as p, create_test_dataset(p) as ds:

0 commit comments

Comments
 (0)