def test_link_not_dir(self): linkname = 'IMA_file_link_unit_test' linkpath = os.path.join(self.base_dir_path, linkname) os.symlink(self.actual_file_path, linkpath) res = helper_functions.is_symlink_dir(linkpath) os.remove(linkpath) self.failIf(res, "Returned true on a symlink to a file.")
def test_link_not_dir(self): linkname = 'IMA_file_link_unit_test' linkpath = os.path.join(self.base_dir_path, linkname) os.symlink(self.actual_file_path, linkpath) res = helper_functions.is_symlink_dir(linkpath) os.remove(linkpath) self.failIf(res, "Returned true on a symlink to a file.")
def test_link_dir(self): linkname = 'IMA_dir_link_unit_test' linkpath = os.path.join(self.base_dir_path, linkname) realdir = tempfile.mkdtemp(suffix='_unit_test', dir=self.base_dir_path) os.symlink(realdir, linkpath) res = helper_functions.is_symlink_dir(linkpath) os.remove(linkpath) os.rmdir(realdir) self.assert_(res, "Linked dir not correctly identified.")
def test_link_dir(self): linkname = 'IMA_dir_link_unit_test' linkpath = os.path.join(self.base_dir_path, linkname) realdir = tempfile.mkdtemp(suffix='_unit_test', dir=self.base_dir_path) os.symlink(realdir, linkpath) res = helper_functions.is_symlink_dir(linkpath) os.remove(linkpath) os.rmdir(realdir) self.assert_(res, "Linked dir not correctly identified.")
def test_not_link_not_dir(self): res = helper_functions.is_symlink_dir(self.actual_file_path) self.failIf(res, "Returned true on a regular file.")
def test_not_link_dir(self): self.failIf(helper_functions.is_symlink_dir(self.base_dir_path), "Returned true on a dir that wasn't a link.")
def test_not_link_not_dir(self): res = helper_functions.is_symlink_dir(self.actual_file_path) self.failIf(res, "Returned true on a regular file.")
def test_not_link_dir(self): self.failIf(helper_functions.is_symlink_dir(self.base_dir_path), "Returned true on a dir that wasn't a link.")