/examples/libtest/VarsTest.py

http://pyjamas.googlecode.com/ · Python · 16 lines · 13 code · 3 blank · 0 comment · 2 complexity · dde433664d1fdb02892cef08c515ac42 MD5 · raw file

  1. from UnitTest import UnitTest
  2. class VarsTest(UnitTest):
  3. def __init__(self):
  4. UnitTest.__init__(self)
  5. def getName(self):
  6. return "Vars"
  7. def testChangeVarInInnerScope(self):
  8. x = 5
  9. if x == 1:
  10. x = 2
  11. elif x == 5:
  12. x = 3
  13. self.assertEqual(x, 3, "the value of x should be 3")