File tree Expand file tree Collapse file tree 2 files changed +21
-25
lines changed Expand file tree Collapse file tree 2 files changed +21
-25
lines changed Original file line number Diff line number Diff line change @@ -524,34 +524,26 @@ def func(project):
524524 )
525525 time .sleep (2 )
526526
527- return func
527+ return func
528+
528529
529530@pytest .fixture
530531def ontology (client ):
531532 ontology_builder = OntologyBuilder (
532533 tools = [
533- Tool (
534- tool = Tool .Type .BBOX ,
535- name = "Box 1" ,
536- color = "#ff0000"
537- ),
538- Tool (
539- tool = Tool .Type .BBOX ,
540- name = "Box 2" ,
541- color = "#ff0000"
542- )
534+ Tool (tool = Tool .Type .BBOX , name = "Box 1" , color = "#ff0000" ),
535+ Tool (tool = Tool .Type .BBOX , name = "Box 2" , color = "#ff0000" )
543536 ],
544537 classifications = [
545- Classification (
546- name = "Root Class" ,
547- class_type = Classification .Type .RADIO ,
548- options = [
549- Option (value = "1" , label = "Option 1" ),
550- Option (value = "2" , label = "Option 2" )
551- ]
552- )
553- ]
554- )
555- ontology = client .create_ontology ('Integration Test Ontology' , ontology_builder .asdict (), MediaType .Image )
538+ Classification (name = "Root Class" ,
539+ class_type = Classification .Type .RADIO ,
540+ options = [
541+ Option (value = "1" , label = "Option 1" ),
542+ Option (value = "2" , label = "Option 2" )
543+ ])
544+ ])
545+ ontology = client .create_ontology ('Integration Test Ontology' ,
546+ ontology_builder .asdict (),
547+ MediaType .Image )
556548 yield ontology
557- client .delete_unused_ontology (ontology .uid )
549+ client .delete_unused_ontology (ontology .uid )
Original file line number Diff line number Diff line change 55import json
66import time
77
8+
89def test_delete_tool_feature_from_ontology (client , ontology ):
910 feature_schema_to_delete = ontology .normalized ['tools' ][0 ]
10- result = client .delete_feature_schema_from_ontology (ontology .uid , feature_schema_to_delete ['featureSchemaId' ])
11- assert result ['deleted' ] == True
11+ result = client .delete_feature_schema_from_ontology (
12+ ontology .uid , feature_schema_to_delete ['featureSchemaId' ])
13+ assert result ['deleted' ] == True
1214 assert result ['archived' ] == False
1315
1416
@@ -27,6 +29,7 @@ def test_from_project_ontology(project) -> None:
2729 color = "#ff0000" ,
2830)
2931
32+
3033def test_deletes_an_ontology (client ):
3134 tool = client .upsert_feature_schema (point .asdict ())
3235 feature_schema_id = tool .normalized ['featureSchemaId' ]
@@ -39,6 +42,7 @@ def test_deletes_an_ontology(client):
3942
4043 client .delete_unused_feature_schema (feature_schema_id )
4144
45+
4246def test_cant_delete_an_ontology_with_project (client ):
4347 project = client .create_project (name = "test project" ,
4448 media_type = MediaType .Image )
You can’t perform that action at this time.
0 commit comments