예제 #1
0
def test_package_simple():
    compilePackage("simplePackage", { "__init__.py" : "import a\nimport b\ndef f(): return a.f() + b.f()",
                                      "a.py" : "def f() : return 10",
                                      "b.py" : "def f() : return 20"})
                                      
    import simplePackage
    AreEqual(simplePackage.f(), 30)       
    AreEqual(simplePackage.a.f(), 10)
    AreEqual(simplePackage.b.f(), 20)
예제 #2
0
 def test_package_simple(self):
     self.compilePackage("simplePackage", { "__init__.py" : "import a\nimport b\ndef f(): return a.f() + b.f()",
                                     "a.py" : "def f() : return 10",
                                     "b.py" : "def f() : return 20"})
                                     
     import simplePackage
     self.assertEqual(simplePackage.f(), 30)       
     self.assertEqual(simplePackage.a.f(), 10)
     self.assertEqual(simplePackage.b.f(), 20)
예제 #3
0
def test_package_simple():
    compilePackage("simplePackage", { "__init__.py" : "import a\nimport b\ndef f(): return a.f() + b.f()",
                                      "a.py" : "def f() : return 10",
                                      "b.py" : "def f() : return 20"})
                                      
    import simplePackage
    AreEqual(simplePackage.f(), 30)       
    AreEqual(simplePackage.a.f(), 10)
    AreEqual(simplePackage.b.f(), 20)
예제 #4
0
 def test_package_simple(self):
     self.compilePackage("simplePackage", { "__init__.py" : "import a\nimport b\ndef f(): return a.f() + b.f()",
                                     "a.py" : "def f() : return 10",
                                     "b.py" : "def f() : return 20"})
                                     
     import simplePackage
     self.assertEqual(simplePackage.f(), 30)       
     self.assertEqual(simplePackage.a.f(), 10)
     self.assertEqual(simplePackage.b.f(), 20)