Browse Source

Move test data

pull/1544/head
Hironsan 3 years ago
parent
commit
e089c142aa
7 changed files with 5 additions and 8 deletions
  1. 3
      backend/api/tests/data/example.jsonl
  2. 0
      backend/api/tests/data/text_classification/classification.jsonl
  3. 0
      backend/api/tests/data/text_classification/example.csv
  4. 0
      backend/api/tests/data/text_classification/example.json
  5. 0
      backend/api/tests/data/text_classification/example.xlsx
  6. 0
      backend/api/tests/data/text_classification/example_fasttext.txt
  7. 10
      backend/api/tests/test_tasks.py

3
backend/api/tests/data/example.jsonl

@ -1,3 +0,0 @@
{"text": "example"}
{"text": "example"}
{"text": "example"}

backend/api/tests/data/classification.jsonl → backend/api/tests/data/text_classification/classification.jsonl

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

backend/api/tests/data/example.json → backend/api/tests/data/text_classification/example.json

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

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

10
backend/api/tests/test_tasks.py

@ -29,28 +29,28 @@ class TestIngestClassificationData(TestCase):
self.assertEqual(Category.objects.count(), expected_annotation)
def test_jsonl(self):
filename = 'classification.jsonl'
filename = 'text_classification/example.jsonl'
file_format = 'JSONL'
kwargs = {'column_label': 'labels'}
self.assert_count(filename, file_format, kwargs, expected_example=4, expected_label=3, expected_annotation=5)
def test_csv(self):
filename = 'example.csv'
filename = 'text_classification/example.csv'
file_format = 'CSV'
self.assert_count(filename, file_format, expected_example=4, expected_label=2, expected_annotation=2)
def test_fasttext(self):
filename = 'example_fasttext.txt'
filename = 'text_classification/example_fasttext.txt'
file_format = 'fastText'
self.assert_count(filename, file_format, expected_example=4, expected_label=5, expected_annotation=5)
def test_excel(self):
filename = 'example.xlsx'
filename = 'text_classification/example.xlsx'
file_format = 'Excel'
self.assert_count(filename, file_format, expected_example=3, expected_label=2, expected_annotation=3)
def test_json(self):
filename = 'example.json'
filename = 'text_classification/example.json'
file_format = 'JSON'
self.assert_count(filename, file_format, expected_example=4, expected_label=3, expected_annotation=5)

Loading…
Cancel
Save