Browse Source

Move test data

pull/1544/head
Hironsan 3 years ago
parent
commit
1dad0a65fd
16 changed files with 5 additions and 5 deletions
  1. 10
      backend/api/tests/api/test_label.py
  2. 0
      backend/api/tests/data/label/invalid_labels.json
  3. 0
      backend/api/tests/data/label/valid_labels.json
  4. 0
      backend/api/tests/data/seq2seq/example.jsonl
  5. 0
      backend/api/tests/data/sequence_labeling/labeling.invalid.conll
  6. 0
      backend/api/tests/data/sequence_labeling/labeling.trailing.conll
  7. 0
      backend/api/tests/data/text_classification/example.invalid.2.csv
  8. 0
      backend/api/tests/data/text_classification/example.invalid.2.xlsx
  9. 0
      backend/api/tests/data/text_classification/example_column_and_row_not_matching.csv
  10. 0
      backend/api/tests/data/text_classification/example_column_and_row_not_matching.xlsx
  11. 0
      backend/api/tests/data/text_classification/example_fasttext_label_tag_without_name.txt
  12. 0
      backend/api/tests/data/text_classification/example_fasttext_without_text.txt
  13. 0
      backend/api/tests/data/text_classification/example_one_column.csv
  14. 0
      backend/api/tests/data/text_classification/example_one_column.xlsx
  15. 0
      backend/api/tests/data/text_classification/example_one_column_no_header.xlsx
  16. 0
      backend/api/tests/data/text_classification/example_out_of_order_columns.csv

10
backend/api/tests/api/test_label.py

@ -127,17 +127,17 @@ class TestLabelUploadAPI(APITestCase):
self.assertEqual(response.status_code, expected_status)
def test_allows_project_admin_to_upload_label(self):
self.assert_upload_file('valid_labels.json', self.project.users[0], status.HTTP_201_CREATED)
self.assert_upload_file('label/valid_labels.json', self.project.users[0], status.HTTP_201_CREATED)
def test_disallows_project_member_to_upload_label(self):
for member in self.project.users[1:]:
self.assert_upload_file('valid_labels.json', member, status.HTTP_403_FORBIDDEN)
self.assert_upload_file('label/valid_labels.json', member, status.HTTP_403_FORBIDDEN)
def test_disallows_non_project_member_to_upload_label(self):
self.assert_upload_file('valid_labels.json', self.non_member, status.HTTP_403_FORBIDDEN)
self.assert_upload_file('label/valid_labels.json', self.non_member, status.HTTP_403_FORBIDDEN)
def test_disallows_unauthenticated_user_to_upload_label(self):
self.assert_upload_file('valid_labels.json', expected_status=status.HTTP_403_FORBIDDEN)
self.assert_upload_file('label/valid_labels.json', expected_status=status.HTTP_403_FORBIDDEN)
def test_try_to_upload_invalid_file(self):
self.assert_upload_file('invalid_labels.json', self.project.users[0], status.HTTP_400_BAD_REQUEST)
self.assert_upload_file('label/invalid_labels.json', self.project.users[0], status.HTTP_400_BAD_REQUEST)

backend/api/tests/data/invalid_labels.json → backend/api/tests/data/label/invalid_labels.json

backend/api/tests/data/valid_labels.json → backend/api/tests/data/label/valid_labels.json

backend/api/tests/data/seq2seq.jsonl → backend/api/tests/data/seq2seq/example.jsonl

backend/api/tests/data/labeling.invalid.conll → backend/api/tests/data/sequence_labeling/labeling.invalid.conll

backend/api/tests/data/labeling.trailing.conll → backend/api/tests/data/sequence_labeling/labeling.trailing.conll

backend/api/tests/data/example.invalid.2.csv → backend/api/tests/data/text_classification/example.invalid.2.csv

backend/api/tests/data/example.invalid.2.xlsx → backend/api/tests/data/text_classification/example.invalid.2.xlsx

backend/api/tests/data/example_column_and_row_not_matching.csv → backend/api/tests/data/text_classification/example_column_and_row_not_matching.csv

backend/api/tests/data/example_column_and_row_not_matching.xlsx → backend/api/tests/data/text_classification/example_column_and_row_not_matching.xlsx

backend/api/tests/data/example_fasttext_label_tag_without_name.txt → backend/api/tests/data/text_classification/example_fasttext_label_tag_without_name.txt

backend/api/tests/data/example_fasttext_without_text.txt → backend/api/tests/data/text_classification/example_fasttext_without_text.txt

backend/api/tests/data/example_one_column.csv → backend/api/tests/data/text_classification/example_one_column.csv

backend/api/tests/data/example_one_column.xlsx → backend/api/tests/data/text_classification/example_one_column.xlsx

backend/api/tests/data/example_one_column_no_header.xlsx → backend/api/tests/data/text_classification/example_one_column_no_header.xlsx

backend/api/tests/data/example_out_of_order_columns.csv → backend/api/tests/data/text_classification/example_out_of_order_columns.csv

Loading…
Cancel
Save