Skip to content

Commit

Permalink
Extend tests to validate the new comparator
Browse files Browse the repository at this point in the history
  • Loading branch information
the-code-magician committed Apr 1, 2015
1 parent 304ca46 commit 6ef7d07
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_strain_design_heuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ def test_solution_comparison(self):
self.assertEqual(sol1.__cmp__(sol1), 0)
self.assertEqual(sol1.__cmp__(sol3), 1)

self.assertTrue(sol1 < sol2)
self.assertTrue(sol1 == sol1)
self.assertTrue(sol1 > sol3)

#test gt and lt
self.assertTrue(sol1.__lt__(sol2))
self.assertTrue(sol1.__gt__(sol3))
self.assertFalse(sol1.__lt__(sol1))
self.assertFalse(sol1.__gt__(sol1))
self.assertFalse(sol2.__lt__(sol1))
self.assertFalse(sol3.__gt__(sol1))


#testing issubset
self.assertTrue(sol1.issubset(sol2), msg="Solution 1 is subset of Solution 2")
self.assertFalse(sol2.issubset(sol1), msg="Solution 2 is not subset of Solution 1")
Expand Down

0 comments on commit 6ef7d07

Please sign in to comment.