From f1ff2f6066139485363c0f4309686b969f40e3b5 Mon Sep 17 00:00:00 2001 From: Christian Gill Date: Tue, 30 Jun 2020 16:14:56 +0200 Subject: [PATCH] fix csv testcases to overlook missing labels --- ...lsx => example_column_and_row_not_matching.xlsx} | Bin app/api/tests/test_api.py | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename app/api/tests/data/{example.invalid.1.xlsx => example_column_and_row_not_matching.xlsx} (100%) diff --git a/app/api/tests/data/example.invalid.1.xlsx b/app/api/tests/data/example_column_and_row_not_matching.xlsx similarity index 100% rename from app/api/tests/data/example.invalid.1.xlsx rename to app/api/tests/data/example_column_and_row_not_matching.xlsx diff --git a/app/api/tests/test_api.py b/app/api/tests/test_api.py index 2451b3e1..8c74db01 100644 --- a/app/api/tests/test_api.py +++ b/app/api/tests/test_api.py @@ -1225,11 +1225,11 @@ class TestUploader(APITestCase): file_format='excel', expected_status=status.HTTP_201_CREATED) - def test_cannot_upload_excel_file_does_not_match_column_and_row(self): + def test_can_upload_excel_file_does_not_match_column_and_row(self): self.upload_test_helper(project_id=self.classification_project.id, - filename='example.invalid.1.xlsx', + filename='example_column_and_row_not_matching.xlsx', file_format='excel', - expected_status=status.HTTP_400_BAD_REQUEST) + expected_status=status.HTTP_201_CREATED) def test_cannot_upload_excel_file_has_too_many_columns(self): self.upload_test_helper(project_id=self.classification_project.id, @@ -1402,10 +1402,10 @@ class TestParser(APITestCase): parser=CoNLLParser()) def test_give_classification_data_to_csv_parser(self): - self.parser_helper(filename='example.csv', parser=CSVParser()) + self.parser_helper(filename='example.csv', parser=CSVParser(), include_label=False) def test_give_seq2seq_data_to_csv_parser(self): - self.parser_helper(filename='example.csv', parser=CSVParser()) + self.parser_helper(filename='example.csv', parser=CSVParser(), include_label=False) def test_give_classification_data_to_json_parser(self): self.parser_helper(filename='classification.jsonl', parser=JSONParser())