The string variant of the "one-up" image, however, does not match the number-based one, to the expectation for the test had to be adjusted (basically replacing 1s with 0s).
28 lines
409 B
Python
28 lines
409 B
Python
from gitfiti import str_to_sprite, ONEUP_STR
|
|
|
|
|
|
SYMBOLS = '''
|
|
*******
|
|
*=~~-~~=*
|
|
*~~---~~*
|
|
*=*****=*
|
|
**-*-*-**
|
|
*-----*
|
|
*****
|
|
'''
|
|
|
|
NUMBERS = [
|
|
[0,4,4,4,4,4,4,4,0],
|
|
[4,3,2,2,0,2,2,3,4],
|
|
[4,2,2,0,0,0,2,2,4],
|
|
[4,3,4,4,4,4,4,3,4],
|
|
[4,4,0,4,0,4,0,4,4],
|
|
[0,4,0,0,0,0,0,4,0],
|
|
[0,0,4,4,4,4,4,0,0],
|
|
]
|
|
|
|
|
|
def test_symbols_to_numbers():
|
|
actual = str_to_sprite(SYMBOLS)
|
|
assert actual == NUMBERS
|