Add string test
This commit is contained in:
parent
7e43451eb5
commit
5a2df50e02
1 changed files with 19 additions and 0 deletions
19
tests.py
19
tests.py
|
@ -101,6 +101,25 @@ def test_9x9_peers():
|
|||
assert epeer in peers, '{} not in peers of (3, 3)'.format(epeer)
|
||||
|
||||
|
||||
def test_9x9_str():
|
||||
'''
|
||||
Test string generation/printing.
|
||||
'''
|
||||
b = sudoku.Board()
|
||||
expected_str = '\n'.join(['. . . | . . . | . . .',
|
||||
'. . . | . . . | . . .',
|
||||
'. . . | . . . | . . .',
|
||||
'------+-------+------',
|
||||
'. . . | . . . | . . .',
|
||||
'. . . | . . . | . . .',
|
||||
'. . . | . . . | . . .',
|
||||
'------+-------+------',
|
||||
'. . . | . . . | . . .',
|
||||
'. . . | . . . | . . .',
|
||||
'. . . | . . . | . . .'])
|
||||
assert str(b) == expected_str
|
||||
|
||||
|
||||
def main():
|
||||
nose.main()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue