Пример #1
0
def test_truediv_position_by_big_float():
    p = Position.from_xyz(4, 5, 6)
    assert str(p / 2.5) == "1.6 2 2.4"
Пример #2
0
def test_add_position_to_tuple():
    p1 = (1, 2, 3)
    p2 = Position.from_xyz(4, 5, 6)
    assert str(p1 + p2) == "5 7 9"
Пример #3
0
def test_add_position_to_list():
    p1 = [1, 2, 3]
    p2 = Position.from_xyz(4, 5, 6)
    assert str(p1 + p2) == "~5 ~7 ~9"
Пример #4
0
def test_position_neg_with_positive_coords():
    p1 = Position.from_xyz(1, 2, 3)
    assert str(p1) == "1 2 3"
    p2 = -p1
    assert str(p2) == "-1 -2 -3"
Пример #5
0
def test_add_two_positions():
    p1 = Position.from_xyz(1, 2, 3)
    p2 = Position.from_xyz(4, 5, 6)
    assert str(p1 + p2) == "5 7 9"
Пример #6
0
def test_position_pos_turns_coord_sign_absolute():
    p1 = ~Position.from_xyz(1, 2, 3)
    assert str(p1) == "~1 ~2 ~3"
    p2 = +p1
    assert str(p2) == "1 2 3"
Пример #7
0
def test_position_abs():
    p1 = Position.from_xyz(-1, 2, -3)
    assert str(p1) == "-1 2 -3"
    p2 = abs(p1)
    assert str(p2) == "1 2 3"
Пример #8
0
def test_floordiv_position_with_relative_coords():
    p = ~Position.from_xyz(4, 5, 6)
    assert str(p // 10) == "~ ~ ~"
Пример #9
0
def test_floordiv_position_with_local_coords():
    p = Position.from_xyz(4, 5, 6).local()
    assert str(p // 10) == "^ ^ ^"
Пример #10
0
def test_floordiv_position_by_big_float():
    p = Position.from_xyz(4, 5, 6)
    assert str(p // 2.5) == "1 2 2"
Пример #11
0
def test_floordiv_position_by_small_float():
    p = Position.from_xyz(4, 5, 6)
    assert str(p // 0.5) == "8 10 12"
Пример #12
0
def test_floordiv_position_by_int():
    p = Position.from_xyz(4, 5, 6)
    assert str(p // 10) == "0 0 0"
Пример #13
0
def test_truediv_position_with_local_coords():
    p = Position.from_xyz(4, 5, 6).local()
    assert str(p / 10) == "^0.4 ^0.5 ^0.6"
Пример #14
0
def test_truediv_position_with_relative_coords():
    p = ~Position.from_xyz(4, 5, 6)
    assert str(p / 10) == "~0.4 ~0.5 ~0.6"
Пример #15
0
def test_pow_position_by_small_float():
    p = Position.from_xyz(4, 9, 16)
    assert str(p**0.5) == "2 3 4"
Пример #16
0
def test_modulo_position_by_int():
    p = Position.from_xyz(4, 5, 6)
    assert str(p % 3) == "1 2 0"
Пример #17
0
def test_pow_position_with_relative_coords():
    p = ~Position.from_xyz(4, 9, 16)
    assert str(p**2) == "~16 ~81 ~256"
Пример #18
0
def test_modulo_position_by_big_float():
    p = Position.from_xyz(4, 5, 6)
    assert str(p % 1.5) == "1 0.5 0"
Пример #19
0
def test_pow_position_with_local_coords():
    p = Position.from_xyz(4, 9, 16).local()
    assert str(p**2) == "^16 ^81 ^256"
Пример #20
0
def test_modulo_position_by_small_float():
    p = Position.from_xyz(4, 5, 6)
    assert str(p % 0.9) == "0.4 0.5 0.6"
Пример #21
0
def test_position_abs_does_not_turn_coord_sign_absolute():
    p1 = ~Position.from_xyz(1, 2, 3)
    assert str(p1) == "~1 ~2 ~3"
    p2 = abs(p1)
    assert str(p2) == "~1 ~2 ~3"
Пример #22
0
def test_modulo_position_with_relative_coords():
    p = ~Position.from_xyz(4, 5, 6)
    assert str(p % 3) == "~1 ~2 ~"
Пример #23
0
def test_position_invert_turns_coord_sign_relative():
    p1 = Position.from_xyz(1, 2, 3)
    assert str(p1) == "1 2 3"
    p2 = ~p1
    assert str(p2) == "~1 ~2 ~3"
Пример #24
0
def test_modulo_position_with_local_coords():
    p = Position.from_xyz(4, 5, 6).local()
    assert str(p % 3) == "^1 ^2 ^"
Пример #25
0
def test_add_tuple_to_position():
    p1 = Position.from_xyz(1, 2, 3)
    p2 = (4, 5, 6)
    assert str(p1 + p2) == "5 7 9"
Пример #26
0
def test_pow_position_by_int():
    p = Position.from_xyz(4, 9, 16)
    assert str(p**2) == "16 81 256"
Пример #27
0
def test_add_list_to_position():
    p1 = Position.from_xyz(1, 2, 3)
    p2 = [4, 5, 6]
    assert str(p1 + p2) == "5 7 9"
Пример #28
0
def test_pow_position_by_big_float():
    p = Position.from_xyz(4, 9, 16)
    assert str(p**1.5) == "8 27 64"
Пример #29
0
def test_add_absolute_position_to_relative_position():
    p1 = ~Position.from_xyz(1, 2, 3)
    p2 = Position.from_xyz(4, 5, 6)
    assert str(p1 + p2) == "~5 ~7 ~9"
Пример #30
0
def test_position_neg_with_mixed_coords():
    p1 = Position.from_xyz(-1, 2, -3)
    assert str(p1) == "-1 2 -3"
    p2 = -p1
    assert str(p2) == "1 -2 3"