示例#1
0
 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
 def test_exists(self):
     self.assertTrue(File.exists(r'testResources\FileTest.txt'))
     self.assertFalse(File.exists(r'testResources\FILEDOESNOTEXIST.txt'))
示例#3
0
 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')