예제 #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"