mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
convert to unittest
This commit is contained in:
parent
21b0360197
commit
3e9a071926
1 changed files with 17 additions and 20 deletions
|
@ -1,31 +1,28 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Written by Shlomi Fish, under the MIT Expat License.
|
# Written by Shlomi Fish, under the MIT Expat License.
|
||||||
|
|
||||||
# imports
|
import unittest
|
||||||
import sys
|
|
||||||
from TAP.Simple import diag, plan, ok
|
|
||||||
|
|
||||||
from pysollib.acard import AbstractCard
|
from pysollib.acard import AbstractCard
|
||||||
from pysollib.hint import Base_Solver_Hint
|
from pysollib.hint import Base_Solver_Hint
|
||||||
|
|
||||||
|
|
||||||
def shlomif_main(args):
|
class MyTests(unittest.TestCase):
|
||||||
|
def test_output(self):
|
||||||
|
card = AbstractCard(1001, 0, 3, 7, 3001)
|
||||||
|
h = Base_Solver_Hint(None, None, base_rank=0)
|
||||||
|
|
||||||
plan(2)
|
got = h.card2str2(card)
|
||||||
|
# TEST
|
||||||
|
self.assertEqual(got, 'D-8', 'card2str2 works')
|
||||||
|
# diag('got == ' + got)
|
||||||
|
|
||||||
card = AbstractCard(1001, 0, 3, 7, 3001)
|
got = h.card2str1(card)
|
||||||
h = Base_Solver_Hint(None, None, base_rank=0)
|
# TEST
|
||||||
|
self.assertEqual(got, '8D', 'card2str2 works')
|
||||||
got = h.card2str2(card)
|
# diag('got == ' + got)
|
||||||
# TEST
|
|
||||||
if not ok(got == 'D-8', 'card2str2 works'):
|
|
||||||
diag('got == ' + got)
|
|
||||||
|
|
||||||
got = h.card2str1(card)
|
|
||||||
# TEST
|
|
||||||
if not ok(got == '8D', 'card2str1 works'):
|
|
||||||
diag('got == ' + got)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == '__main__':
|
||||||
sys.exit(shlomif_main(sys.argv))
|
from pycotap import TAPTestRunner
|
||||||
|
suite = unittest.TestLoader().loadTestsFromTestCase(MyTests)
|
||||||
|
TAPTestRunner().run(suite)
|
||||||
|
|
Loading…
Add table
Reference in a new issue