You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
866 B

  1. import unittest
  2. from ..pipeline.catalog import Options
  3. from projects.models import (
  4. BOUNDING_BOX,
  5. DOCUMENT_CLASSIFICATION,
  6. IMAGE_CAPTIONING,
  7. IMAGE_CLASSIFICATION,
  8. INTENT_DETECTION_AND_SLOT_FILLING,
  9. SEGMENTATION,
  10. SEQ2SEQ,
  11. SEQUENCE_LABELING,
  12. SPEECH2TEXT,
  13. )
  14. class TestOptions(unittest.TestCase):
  15. def test_return_at_least_one_option(self):
  16. tasks = [
  17. BOUNDING_BOX,
  18. DOCUMENT_CLASSIFICATION,
  19. IMAGE_CAPTIONING,
  20. IMAGE_CLASSIFICATION,
  21. INTENT_DETECTION_AND_SLOT_FILLING,
  22. SEGMENTATION,
  23. SEQ2SEQ,
  24. SEQUENCE_LABELING,
  25. SPEECH2TEXT,
  26. ]
  27. for task in tasks:
  28. with self.subTest(task=task):
  29. options = Options.filter_by_task(task)
  30. self.assertGreaterEqual(len(options), 1)