def test_adds_lines_to_modelspace(self, app_data):
     with patch('dxf.write.write_loading_dxf.ezdxf.new') as mock_dwg:
         mock_msp = Mock()
         type(mock_dwg.return_value).modelspace = mock_msp
         mock_add_line = Mock()
         type(mock_msp.return_value).add_line = mock_add_line
         loading_dxf = LoadingsDxf(app_data)
         region_lines = loading_dxf.getLoadingRegionLines(6354.)[1]
         loading_dxf.createLines(region_lines, 804)
         mock_msp.assert_called()
         assert mock_add_line.call_count == 136
 def test_loading_region_lines_for_negative_direction1(self, app_data):
     loading_dxf = LoadingsDxf(app_data)
     end_node, lines = loading_dxf.getLoadingRegionLines(-14400.)
     assert len(lines) == 292
     assert end_node == 100
 def test_gets_right_number_of_loading_region_lines2(self, app_data):
     loading_dxf = LoadingsDxf(app_data)
     end_node, lines = loading_dxf.getLoadingRegionLines(1000.)
     assert len(lines) == 58
     assert end_node == 20
 def test_gets_right_number_of_loading_region_lines1(self, app_data):
     loading_dxf = LoadingsDxf(app_data)
     end_node, lines = loading_dxf.getLoadingRegionLines(6354.)
     assert len(lines) == 136
     assert end_node == 60
 def test_gets_right_number_region_nodes_for_gravity_loads(
         self, app_data, wind_design):
     loadings_dxf = LoadingsDxf(app_data, wind_design)
     start_node, lines = loadings_dxf.getLoadingRegionLines(0)
     assert len(lines) == 487
     assert start_node == None
 def test_loading_region_lines_for_y_negative_direction2(self, app_data):
     loading_dxf = LoadingsDxf(app_data)
     end_node, lines = loading_dxf.getLoadingRegionLines(38000., 10, True)
     assert len(lines) == 237
     assert end_node == None
 def test_loading_region_lines_for_y_negative_direction(self, app_data):
     loading_dxf = LoadingsDxf(app_data)
     end_node, lines = loading_dxf.getLoadingRegionLines(19000.,
                                                         y_direction=True)
     assert len(lines) == 262
     assert end_node == 10
 def test_loading_region_lines_for_negative_direction5(self, app_data):
     loading_dxf = LoadingsDxf(app_data)
     end_node, lines = loading_dxf.getLoadingRegionLines(-24000., 100)
     assert len(lines) == 214
     assert end_node == None