1
- import bastardize
1
+ import pyevil
2
2
3
3
4
4
def test_int_copy ():
5
5
"""
6
6
If you're mutating ints, you might want copies...
7
7
"""
8
- newone = bastardize .int_copy (1 )
8
+ newone = pyevil .int_copy (1 )
9
9
assert newone == 1
10
10
assert not (newone is 1 )
11
11
@@ -15,15 +15,15 @@ def test_int_copy_neg():
15
15
Because Python has a weird representation for negative ints,
16
16
test this, too...
17
17
"""
18
- someneg = bastardize .int_copy (- 10 )
18
+ someneg = pyevil .int_copy (- 10 )
19
19
assert someneg == - 10
20
20
assert not (someneg is - 10 )
21
21
22
22
23
23
def test_int_mutate ():
24
- one = bastardize .int_copy (1 )
24
+ one = pyevil .int_copy (1 )
25
25
assert one == 1
26
- bastardize .int_mutate (one , 2 )
26
+ pyevil .int_mutate (one , 2 )
27
27
assert one != 1
28
28
assert one == 2
29
29
assert one + one == 4
@@ -36,7 +36,7 @@ def test_evil_int_mutate():
36
36
(If you're bold, try changing the value of 1 and see how many libraries you can break.)
37
37
"""
38
38
assert 800 != 900
39
- bastardize .int_mutate (800 , 900 , force = True )
39
+ pyevil .int_mutate (800 , 900 , force = True )
40
40
assert 800 == 900
41
41
assert 400 + 400 != 800 # *evil laugh*
42
42
@@ -45,17 +45,17 @@ def test_float_mutate():
45
45
"""
46
46
Let's mess with floats, too.
47
47
"""
48
- bastardize .float_mutate (2.0 , 1.5 )
48
+ pyevil .float_mutate (2.0 , 1.5 )
49
49
assert 2.0 * 2 == 3
50
50
51
51
52
52
def test_float_mutate_copy ():
53
53
"""
54
54
We can use copies, too...
55
55
"""
56
- three = bastardize .float_copy (3.0 )
56
+ three = pyevil .float_copy (3.0 )
57
57
still_three = three
58
- bastardize .float_mutate (three , 4.0 )
58
+ pyevil .float_mutate (three , 4.0 )
59
59
# We've taken a float object and changed its value.
60
60
# This is different from reassigning to a new object,
61
61
# On the surface, it looks kind of the same as `three = 4.0`
@@ -71,5 +71,5 @@ def test_tuple_set_item():
71
71
data[0] = 4 # Gives TypeError: 'tuple' object does not support item assignment
72
72
"""
73
73
data = (1 ,2 ,3 )
74
- bastardize .tuple_set_item (data , index = 0 , value = 4 )
74
+ pyevil .tuple_set_item (data , index = 0 , value = 4 )
75
75
assert data == (4 ,2 ,3 )
0 commit comments