def test_add_wrong_elements(self): viewer = IntegrableViewer() assert viewer.mesh() is None assert viewer.blocks() is None assert viewer.points() is None assert viewer.lines() is None assert viewer.tubes() is None assert viewer.load_mesh('') is None assert viewer.load_blocks('') is None assert viewer.load_points('') is None assert viewer.load_lines('') is None assert viewer.load_tubes('') is None assert len(viewer.get_all_drawables()) == 0
def test_load_elements(self): viewer = IntegrableViewer() # Mesh mesh = viewer.load_mesh(f'{TEST_FILES_FOLDER_PATH}/caseron.dxf') assert type(mesh) is MeshGL assert viewer.last_id == mesh.id assert viewer.last_drawable is mesh assert len(viewer.get_all_drawables()) == 1 # Blocks blocks = viewer.load_blocks(f'{TEST_FILES_FOLDER_PATH}/mini.csv') assert type(blocks) is BlockGL assert viewer.last_id == blocks.id assert viewer.last_drawable is blocks assert len(viewer.get_all_drawables()) == 2 # Points points = viewer.load_points(f'{TEST_FILES_FOLDER_PATH}/mini.csv') assert type(points) is PointGL assert viewer.last_id == points.id assert viewer.last_drawable is points assert len(viewer.get_all_drawables()) == 3 # Lines lines = viewer.load_lines(f'{TEST_FILES_FOLDER_PATH}/mini.csv') assert type(lines) is LineGL assert viewer.last_id == lines.id assert viewer.last_drawable is lines assert len(viewer.get_all_drawables()) == 4 # Tubes tubes = viewer.load_tubes(f'{TEST_FILES_FOLDER_PATH}/mini.csv') assert type(tubes) is TubeGL assert viewer.last_id == tubes.id assert viewer.last_drawable is tubes assert len(viewer.get_all_drawables()) == 5