Skip to content

Commit

Permalink
added eval tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Oct 3, 2023
1 parent c749a82 commit 347adff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cat_win/tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ def test_wrong_input(self):
self.assertEqual(converter.is_bin('2'), expected_output)
self.assertEqual(converter.is_bin('0x1'), expected_output)

def test_evaluate_integrated(self):
self.assertEqual(converter.evaluate('test11**2test', True), 'test121test')
self.assertEqual(converter.evaluate('test(5/(3-0x3))test', True), 'test???test')

def test_evaluate_not_integrated(self):
self.assertEqual(converter.evaluate('test11**2test', False), '121')
self.assertEqual(converter.evaluate('test(5/(3-0x3))test', False), '???')

def test_exception_handler(self):
exc = ZeroDivisionError()
group = '1/0'
Expand Down

0 comments on commit 347adff

Please sign in to comment.