from unittest import TestCase

from src.superannotate import SAClient

sa = SAClient()


class TestListWorkflows(TestCase):
    def test_list_workflows(self):
        workflows = sa.list_workflows()
        assert workflows
        first_workflow = workflows[0]
        assert first_workflow["id"] == 1
        assert first_workflow["type"] == "system"
        assert first_workflow["createdAt"]
        assert first_workflow["updatedAt"]
        assert first_workflow["name"] == "System workflow"
        assert first_workflow["description"] == (
            "This workflow is generated by the "
            "system, and prevents annotators from completing items."
        )
        assert first_workflow["raw_config"]
