Esempio n. 1
0
 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.")
Esempio n. 2
0
 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.")
Esempio n. 3
0
 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.")
Esempio n. 4
0
 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.")
Esempio n. 5
0
 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.")
Esempio n. 6
0
 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.")
Esempio n. 7
0
 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.")
Esempio n. 8
0
 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.")