コード例 #1
0
ファイル: TestFile.py プロジェクト: MBijron/Python
 def test_delete(self):
     File.copy('testResources\\FileTest.txt',
               "testResources\\FileTestTemp.txt")
     self.assertTrue(File.exists("testResources\\FileTestTemp.txt"))
     File.delete("testResources\\FileTestTemp.txt")
     self.assertFalse(File.exists("testResources\\FileTestTemp.txt"))
     pass
コード例 #2
0
ファイル: TestFile.py プロジェクト: MBijron/Python
 def test_exists(self):
     self.assertTrue(File.exists(r'testResources\FileTest.txt'))
     self.assertFalse(File.exists(r'testResources\FILEDOESNOTEXIST.txt'))
コード例 #3
0
ファイル: ResourceHandler.py プロジェクト: MBijron/Python
 def get_resource_path(resource):
     # TODO: write unit test
     if File.exists(Path.combine(Path.get_file_path(__file__), resource)):
         return Path.combine(Path.get_file_path(__file__), resource)
     else:
         raise Exception('The given resource could not be found')