Skip to content

Commit 5cd1757

Browse files
authored
Merge pull request #162 from mcneilco/ACAS-760
ACAS-760: Added experiment loader warning test for numerics in Numbers that will be saved as Text
2 parents a96aa8c + c21ecfb commit 5cd1757

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

tests/test_acasclient.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -4812,7 +4812,7 @@ def test_018_image_file(self):
48124812
self.experiment_load_test(data_file_to_upload, False, images_file_to_upload=image_file_path)
48134813

48144814
@requires_basic_cmpd_reg_load
4815-
def test_19_project_restrictions(self):
4815+
def test_019_project_restrictions(self):
48164816
"""Check experiment loader project restrictions are working."""
48174817

48184818
# Setup for tests
@@ -4857,3 +4857,17 @@ def test_19_project_restrictions(self):
48574857
file_to_upload = get_basic_experiment_load_file(self.tempdir, project_code=None, corp_name=restricted_lot_corp_name_2, file_name='uniform-commas-with-quoted-text.csv')
48584858
# Upload the file and expect it to succeed
48594859
response = self.experiment_load_test(file_to_upload, False, expect_failure=False)
4860+
4861+
@requires_basic_cmpd_reg_load
4862+
def test_020_datatype_number_parsing(self):
4863+
"""Test experiment loader number parsing."""
4864+
data_file_to_upload = Path(__file__).resolve()\
4865+
.parent.joinpath('test_acasclient', 'datatype-number-parsing.csv')
4866+
response = self.experiment_load_test(data_file_to_upload, False, expect_failure=False)
4867+
expected_messages = [
4868+
{
4869+
"errorLevel": "warning",
4870+
"message": "The following Number values contain numerics but could not be parsed as Number so will be saved as Text: 'Test1.0Test', '1.0Test', 'Test1.0'. To avoid this warning set only non-numerics like 'Bad Solutibility', or use a correctly formatted Number. For example, 1, 1.2, 1.23e-10, >1, <1"
4871+
}
4872+
]
4873+
self.check_expected_messages(expected_messages, response['errorMessages'])
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Experiment Meta Data,,,
2+
Format,Generic,,
3+
Protocol Name,BLAH,,
4+
Experiment Name,BLAH,,
5+
Scientist,bob,,
6+
Notebook,BLAH,,
7+
Page,,,
8+
Assay Date,2022-03-30,,
9+
Project,Global,,
10+
,,,
11+
,,,
12+
Calculated Results,,,
13+
Datatype,Number,Number,Number,Number,Number,Number,Number,Text,Number,Number,Number
14+
Corporate Batch ID,Integer,Decimal,Scientific Notation,StartsWithString,EndsWithString,ContainsString,IsString,NumberSavedAsStringOnPurpose,EmptyValue,GreaterThanOperator,LessThanOperator
15+
"CMPD-0000001-001",1,1.2,1.23e-10,Test1.0,1.0Test,Test1.0Test,Test,1.3,,>1.0,<1.0

0 commit comments

Comments
 (0)