def test_horizontal(self): result = utils.connect_2d_shapes(self.shapes, 10, 'horizontal') vector = [0, 1, 0] assert result == ast.Rotate(90, vector, self.union)
def test_connect_invalid_arguments(): """Test that arguments for ``connect_2d_shapes`` are validated.""" shapes = [ast.Circle(5), ast.Circle(2)] with pytest.raises(AssertionError): utils.connect_2d_shapes(shapes, 10, 'diagonal')
def test_vertical(self): result = utils.connect_2d_shapes(self.shapes, 10, 'vertical') assert result == self.union
def test_vertical_quads(self): result = utils.connect_2d_shapes(self.shapes, 5, 'vertical') assert result.items[0].item.quads == self.union.items[0].item.quads assert result.items[1].item.quads == self.union.items[1].item.quads
def test_connect_heterogenous_handling(): """Assert that heterogenous shapes cannot be merged.""" shapes = [ast.Circle(5), ast.Rectangle(2, 3)] with pytest.raises(NotImplementedError): utils.connect_2d_shapes(shapes, 10, 'vertical')
def test_horizontal(self): result = utils.connect_2d_shapes(self.shapes, 10, "horizontal") vector = [0, 1, 0] assert result == ast.Rotate(90, vector, self.union)
def test_vertical(self): result = utils.connect_2d_shapes(self.shapes, 10, "vertical") assert result == self.union
def test_connect_invalid_arguments(): """Test that arguments for ``connect_2d_shapes`` are validated.""" shapes = [ast.Circle(5), ast.Circle(2)] with pytest.raises(AssertionError): utils.connect_2d_shapes(shapes, 10, "diagonal")
def test_connect_heterogenous_handling(): """Assert that heterogenous shapes cannot be merged.""" shapes = [ast.Circle(5), ast.Rectangle(2, 3)] with pytest.raises(NotImplementedError): utils.connect_2d_shapes(shapes, 10, "vertical")
def test_vertical_quads(self): result = utils.connect_2d_shapes(self.shapes, 5, "vertical") assert result.items[0].item.quads == self.union.items[0].item.quads assert result.items[1].item.quads == self.union.items[1].item.quads