Skip to content

Commit

Permalink
Add test cases for utils module
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiston999 committed May 5, 2017
1 parent da56d59 commit e74cd7e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest
from rubik_solver.Solver import Beginner, CFOP, Kociemba

class MockSolver(object): pass

class TestUtils(unittest.TestCase):
solve_methods = [
Expand All @@ -17,6 +18,12 @@ def test_solve(self):
with self.assertRaises(TypeError):
utils.solve(c, None)

with self.assertRaises(ValueError):
utils.solve(None, "INVALID SOLVER")

with self.assertRaises(ValueError):
utils.solve(None, MockSolver)

with self.assertRaises(ValueError):
utils.solve(None, self.solve_methods[0])

Expand Down Expand Up @@ -47,7 +54,7 @@ def test_solve(self):
def test_pprint(self):
c = Cube()
with self.assertRaises(ValueError):
utils.solve(None)
utils.pprint(None)

with self.assertRaises(ValueError):
utils.solve(1)
utils.pprint(1)

0 comments on commit e74cd7e

Please sign in to comment.