|
9 | 9 | from tests.integration.base import BaseTestCase |
10 | 10 |
|
11 | 11 |
|
| 12 | +class TestWorkflowGet(BaseTestCase): |
| 13 | + PROJECT_NAME = "TestWorkflowGet" |
| 14 | + PROJECT_TYPE = "Vector" |
| 15 | + PROJECT_DESCRIPTION = "DESCRIPTION" |
| 16 | + |
| 17 | + def test_workflow_get(self): |
| 18 | + sa.create_annotation_class( |
| 19 | + self.PROJECT_NAME, |
| 20 | + "class1", |
| 21 | + "#FFAAFF", |
| 22 | + [ |
| 23 | + { |
| 24 | + "name": "tall", |
| 25 | + "is_multiselect": 0, |
| 26 | + "attributes": [{"name": "yes"}, {"name": "no"}], |
| 27 | + }, |
| 28 | + { |
| 29 | + "name": "age", |
| 30 | + "is_multiselect": 0, |
| 31 | + "attributes": [{"name": "young"}, {"name": "old"}], |
| 32 | + }, |
| 33 | + ], |
| 34 | + ) |
| 35 | + sa.create_annotation_class( |
| 36 | + self.PROJECT_NAME, |
| 37 | + "class2", |
| 38 | + "#FFAAFF", |
| 39 | + [ |
| 40 | + { |
| 41 | + "name": "tall", |
| 42 | + "is_multiselect": 0, |
| 43 | + "attributes": [{"name": "yes"}, {"name": "no"}], |
| 44 | + }, |
| 45 | + { |
| 46 | + "name": "age", |
| 47 | + "is_multiselect": 0, |
| 48 | + "attributes": [{"name": "young"}, {"name": "old"}], |
| 49 | + }, |
| 50 | + ], |
| 51 | + ) |
| 52 | + sa.set_project_workflow( |
| 53 | + self.PROJECT_NAME, |
| 54 | + [ |
| 55 | + { |
| 56 | + "step": 1, |
| 57 | + "className": "class1", |
| 58 | + "tool": 3, |
| 59 | + "attribute": [ |
| 60 | + { |
| 61 | + "attribute": { |
| 62 | + "name": "young", |
| 63 | + "attribute_group": {"name": "age"}, |
| 64 | + } |
| 65 | + }, |
| 66 | + { |
| 67 | + "attribute": { |
| 68 | + "name": "yes", |
| 69 | + "attribute_group": {"name": "tall"}, |
| 70 | + } |
| 71 | + }, |
| 72 | + ], |
| 73 | + }, |
| 74 | + { |
| 75 | + "step": 2, |
| 76 | + "className": "class2", |
| 77 | + "tool": 3, |
| 78 | + "attribute": [ |
| 79 | + { |
| 80 | + "attribute": { |
| 81 | + "name": "young", |
| 82 | + "attribute_group": {"name": "age"}, |
| 83 | + } |
| 84 | + }, |
| 85 | + { |
| 86 | + "attribute": { |
| 87 | + "name": "yes", |
| 88 | + "attribute_group": {"name": "tall"}, |
| 89 | + } |
| 90 | + }, |
| 91 | + ], |
| 92 | + } |
| 93 | + ], |
| 94 | + ) |
| 95 | + workflows = sa.get_project_workflow(self.PROJECT_NAME) |
| 96 | + self.assertEqual(workflows[0]['className'], "class1") |
| 97 | + self.assertEqual(workflows[1]['className'], "class2") |
| 98 | + |
12 | 99 |
|
13 | 100 | class TestProjectCreateMetadata(BaseTestCase): |
14 | 101 | PROJECT_NAME = "sample_basic_project" |
|
0 commit comments