Example #1
0
  def testFileHelperDir(self):
    dir = opj(self.tempdir,"testdir")

    # create dir:
    file_helper.create_dir(dir)

    # test if it can be destroyed:
    file_helper.destroy_dir_recursive(dir)
    self.assertEqual(file_helper.dir_exists(dir),False)
    def testFileHelperDir(self):
        dir = opj(self.tempdir, "testdir")

        # create dir:
        file_helper.create_dir(dir)

        # test if it can be destroyed:
        file_helper.destroy_dir_recursive(dir)
        self.assertEqual(file_helper.dir_exists(dir), False)
Example #3
0
  def testFileHelperDirError(self):
    # create dir at not existing location:
    try:
      exception = False
      file_helper.create_dir(opj(self.tempdir,"notexisting","testdir"))
    except:
      exception = True

    # should have raised exception (OSError)
    self.assertEqual(exception,True)

    # should not exists:
    self.assertEqual(file_helper.dir_exists(opj(self.tempdir,"testfile")),False)
    def testFileHelperDirError(self):
        # create dir at not existing location:
        try:
            exception = False
            file_helper.create_dir(opj(self.tempdir, "notexisting", "testdir"))
        except:
            exception = True

        # should have raised exception (OSError)
        self.assertEqual(exception, True)

        # should not exists:
        self.assertEqual(file_helper.dir_exists(opj(self.tempdir, "testfile")),
                         False)
Example #5
0
 def testFileHelperDir(self):
   # create dir:
   file_helper.create_dir(opj(self.tempdir,"testdir"))
   # test if it exists:
   self.assertEqual(file_helper.dir_exists(opj(self.tempdir,"testdir")),True)
 def testFileHelperDir(self):
     # create dir:
     file_helper.create_dir(opj(self.tempdir, "testdir"))
     # test if it exists:
     self.assertEqual(file_helper.dir_exists(opj(self.tempdir, "testdir")),
                      True)