def test_adding_a_plain_brick(self, ifc, brick): brick.add_brick("namespace", "brick_class").should_be_called() brick.run_refresh_brick_viewer().should_be_called() subject.add_brick(ifc, brick, element=None, namespace="namespace", brick_class="brick_class", library=None)
def test_do_not_remove_reference_if_no_reference_exists(self, ifc, brick): brick.get_library_brick_reference( "library", "brick_uri").should_be_called().will_return(None) brick.remove_brick("brick_uri").should_be_called() brick.run_refresh_brick_viewer().should_be_called() subject.remove_brick(ifc, brick, library="library", brick_uri="brick_uri")
def test_run(self, ifc, brick): brick.get_library_brick_reference( "library", "brick_uri").should_be_called().will_return("reference") ifc.run("library.remove_reference", reference="reference").should_be_called() brick.remove_brick("brick_uri").should_be_called() brick.run_refresh_brick_viewer().should_be_called() subject.remove_brick(ifc, brick, library="library", brick_uri="brick_uri")
def test_run(self, ifc, brick): brick.get_brick("source").should_be_called().will_return( "source_brick") brick.get_brick("destination").should_be_called().will_return( "destination_brick") brick.add_feed("source_brick", "destination_brick").should_be_called() brick.run_refresh_brick_viewer().should_be_called() subject.add_brick_feed(ifc, brick, source="source", destination="destination")
def test_adding_a_brick_from_an_element(self, ifc, brick): brick.add_brick_from_element( "element", "namespace", "brick_class").should_be_called().will_return("brick_uri") brick.run_refresh_brick_viewer().should_be_called() subject.add_brick(ifc, brick, element="element", namespace="namespace", brick_class="brick_class", library=None)
def test_run(self, brick): brick.get_convertable_brick_elements().should_be_called().will_return( ["element"]) brick.get_brick_class("element").should_be_called().will_return( "brick_class") brick.add_brick_from_element( "element", "namespace", "brick_class").should_be_called().will_return("brick_uri") brick.run_assign_brick_reference( element="element", library="library", brick_uri="brick_uri").should_be_called() brick.run_refresh_brick_viewer().should_be_called() subject.convert_ifc_to_brick(brick, namespace="namespace", library="library")
def test_adding_a_brick_an_auto_assigning_it_to_the_ifc_element( self, ifc, brick): brick.add_brick_from_element( "element", "namespace", "brick_class").should_be_called().will_return("brick_uri") brick.run_assign_brick_reference( element="element", library="library", brick_uri="brick_uri").should_be_called() brick.run_refresh_brick_viewer().should_be_called() subject.add_brick(ifc, brick, element="element", namespace="namespace", brick_class="brick_class", library="library")
def test_do_not_check_references_if_no_library_specified(self, ifc, brick): brick.remove_brick("brick_uri").should_be_called() brick.run_refresh_brick_viewer().should_be_called() subject.remove_brick(ifc, brick, library=None, brick_uri="brick_uri")