PageRenderTime 327ms CodeModel.GetById 161ms app.highlight 7ms RepoModel.GetById 154ms app.codeStats 1ms

/examples/libtest/VarsTest.py

http://pyjamas.googlecode.com/
Python | 16 lines | 13 code | 3 blank | 0 comment | 1 complexity | dde433664d1fdb02892cef08c515ac42 MD5 | raw file
 1from UnitTest import UnitTest
 2
 3class VarsTest(UnitTest):
 4    def __init__(self):
 5        UnitTest.__init__(self)
 6
 7    def getName(self):
 8        return "Vars"
 9 
10    def testChangeVarInInnerScope(self):
11        x = 5
12        if x == 1:
13            x = 2
14        elif x == 5:
15            x = 3
16        self.assertEqual(x, 3, "the value of x should be 3")