Skip to content

Instantly share code, notes, and snippets.

@david-sosa-valdes
Created April 6, 2016 21:47
Show Gist options
  • Save david-sosa-valdes/b3e7ebf35090771be010381462eb3f2f to your computer and use it in GitHub Desktop.
Save david-sosa-valdes/b3e7ebf35090771be010381462eb3f2f to your computer and use it in GitHub Desktop.
Math equation balance (excercise)
import unittest
class MathBalance(object):
def check(self, equation = ''):
return True
class TestMathCases(unittest.TestCase):
def test_first(self):
m = MathBalance()
self.assertEqual(True, m.check('(Ax + BY)'))
def test_second(self):
m = MathBalance()
self.assertEqual(False, m.check('(d(x+y()'))
def test_third(self):
m = MathBalance()
self.assertEqual(False, m.check(')A+b('))
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment