Exemplo n.º 1
0
def test_draw_vertices_error(rc):
    op = ObliqueProjection(rc)
    with pytest.raises(TypeError) as excinfo:
        op.draw_vertices = 'true'
    assert str(excinfo.value) == 'draw_vertices must be a boolean; '\
        'found <class \'str\'> instead.'
Exemplo n.º 2
0
def test_topright_projection(rc):
    """Check the default projection of a right cuboid is correct."""
    assert ObliqueProjection(rc, label_vertices=True).drawn == r"""
Exemplo n.º 3
0
def test_instanciation_object3D_error(rc):
    """Check errors when instanciating a new ObliqueProjection."""
    with pytest.raises(TypeError) as excinfo:
        ObliqueProjection('a')
    assert str(excinfo.value) == 'object3D must be a Polyhedron, found '\
        '\'a\' instead.'
Exemplo n.º 4
0
def test_instanciation_direction_error(rc):
    with pytest.raises(ValueError) as excinfo:
        ObliqueProjection(rc, direction='undefined')
    assert str(excinfo.value) == 'Allowed values for direction argument are '\
        '{}. Found \'undefined\' instead.'.format(config.DIRECTION_VALUES)
Exemplo n.º 5
0
def test_instanciation_angle_error(rc):
    """Check errors when instanciating a new ObliqueProjection."""
    with pytest.raises(TypeError) as excinfo:
        ObliqueProjection(α='a')
    assert str(excinfo.value) == 'Angle α must be a number. Found '\
        '\'a\' instead.'
Exemplo n.º 6
0
def test_draw_thick_and_blue(rc):
    """Check the default projection of a right cuboid is correct."""
    assert ObliqueProjection(rc, color='RoyalBlue',
                             thickness='very thick').drawn == r"""
Exemplo n.º 7
0
def test_bottomright_edges_labeling(rc):
    """Check edges' labeling for a bottom-right projection."""
    rc.setup_labels((4, 7, 25))
    assert ObliqueProjection(rc, direction='bottom-right').drawn == r"""
Exemplo n.º 8
0
def test_topleft_edges_labeling(rc):
    """Check edges' labeling for a top-left projection."""
    rc.setup_labels((4, 7, 25))
    assert ObliqueProjection(rc, direction='top-left').drawn == r"""
Exemplo n.º 9
0
def test_topright_edges_labeling(rc):
    """Check edges' labeling for a top-right projection."""
    rc.setup_labels((4, 7, 25))
    assert ObliqueProjection(rc).drawn == r"""
Exemplo n.º 10
0
def test_bottomright_projection(rc):
    """Check bottom-right projection of a right cuboid is correct."""
    assert ObliqueProjection(rc, label_vertices=True,
                             direction='bottom-right').drawn == r"""
Exemplo n.º 11
0
def test_topleft_projection(rc):
    """Check top-left projection of a right cuboid is correct."""
    assert ObliqueProjection(rc, label_vertices=True,
                             direction='top-left').drawn == r"""