コード例 #1
0
ファイル: test_compiler.py プロジェクト: rudimk/dlr-dotnet
def test_multifile_import_external():
    compileCode("multiFileImportExternal",
                "import external\ndef f(): return external.f()")
    write_to_file(path_combine(testpath.temporary_dir, "external.py"),
                  "def f(): return 'hello'")

    import multiFileImportExternal
    AreEqual(multiFileImportExternal.f(), 'hello')
コード例 #2
0
ファイル: test_compiler.py プロジェクト: zpeach68/ironpython2
    def test_multifile_import_external(self):
        self.compileCode("multiFileImportExternal",
                         "import external\ndef f(): return external.f()")
        self.write_to_file(os.path.join(self.temporary_dir, "external.py"),
                           "def f(): return 'hello'")

        import multiFileImportExternal
        self.assertEqual(multiFileImportExternal.f(), 'hello')
コード例 #3
0
def test_multifile_import_external():
    compileCode("multiFileImportExternal", "import external\ndef f(): return external.f()")    
    write_to_file(path_combine(testpath.temporary_dir, "external.py"), "def f(): return 'hello'")
    
    import multiFileImportExternal
    AreEqual(multiFileImportExternal.f(), 'hello')
コード例 #4
0
 def test_multifile_import_external(self):
     self.compileCode("multiFileImportExternal", "import external\ndef f(): return external.f()")    
     self.write_to_file(os.path.join(self.temporary_dir, "external.py"), "def f(): return 'hello'")
     
     import multiFileImportExternal
     self.assertEqual(multiFileImportExternal.f(), 'hello')