|
25 | 25 | from .world import world, setup_module, teardown_module, show_doc, \ |
26 | 26 | show_method |
27 | 27 | from . import create_source_steps as source_create |
| 28 | +from . import create_dataset_steps as dataset_create |
28 | 29 |
|
29 | 30 |
|
30 | 31 | class TestUploadSource: |
@@ -125,3 +126,38 @@ def test_scenario3(self): |
125 | 126 | source_create.the_source_is_finished( |
126 | 127 | self, example["source_wait"]) |
127 | 128 | source_create.the_cloned_source_origin_is(self, source) |
| 129 | + |
| 130 | + def test_scenario4(self): |
| 131 | + """ |
| 132 | + Scenario: Successfully adding annotatations to composite source: |
| 133 | + Given I create an annotated images data source uploading a "<data>" file |
| 134 | + And I wait until the source is ready less than <source_wait> secs |
| 135 | + And I create a dataset |
| 136 | + And I wait until the dataset is ready less than <dataset_wait> secs |
| 137 | + Then the new dataset has <annotations_num> annotations in the <annotations_field> field |
| 138 | + """ |
| 139 | + headers = ["data", "source_wait", "dataset_wait", "annotations_num", |
| 140 | + "annotations_field"] |
| 141 | + examples = [ |
| 142 | + ['data/images/metadata.json', '500', '500', '12', |
| 143 | + '100002'], |
| 144 | + ['data/images/metadata_compact.json', '500', '500', '3', |
| 145 | + '100003']] |
| 146 | + show_doc(self.test_scenario4) |
| 147 | + for example in examples: |
| 148 | + example = dict(zip(headers, example)) |
| 149 | + show_method(self, self.bigml["method"], example) |
| 150 | + source_create.i_create_annotated_source( |
| 151 | + self, |
| 152 | + example["data"], |
| 153 | + args={"image_analysis": {"enabled": False, |
| 154 | + "extracted_features": []}}) |
| 155 | + source_create.the_source_is_finished( |
| 156 | + self, example["source_wait"]) |
| 157 | + dataset_create.i_create_a_dataset(self) |
| 158 | + dataset_create.the_dataset_is_finished_in_less_than( |
| 159 | + self, example["dataset_wait"]) |
| 160 | + dataset_create.check_annotations(self, |
| 161 | + example["annotations_field"], |
| 162 | + example["annotations_num"]) |
| 163 | + |
0 commit comments