예제 #1
0
파일: model_test.py 프로젝트: albanb/tribud
 def test_add_file(self):
     directory = model.DirHandler(self.path1)
     directory.connect()
     directory.add(os.path.abspath(__file__))
     self.assertTrue(
         os.path.isfile("".join([self.path1,
                                 os.path.abspath(__file__)])))
예제 #2
0
파일: model_test.py 프로젝트: albanb/tribud
 def test_add_symlink_file(self):
     directory = model.DirHandler(self.path1)
     directory.connect()
     directory.add(os.path.abspath(self.symlink_path))
     self.assertTrue(
         os.path.isfile("".join(
             [self.path1, os.path.abspath(self.symlink_path)]))
         and os.path.islink("".join(
             [self.path1, os.path.abspath(self.symlink_path)])))
예제 #3
0
파일: model_test.py 프로젝트: albanb/tribud
 def test_add_directory(self):
     directory = model.DirHandler(self.path1)
     directory.connect()
     directory.add(os.path.abspath(self.path2))
     self.assertEqual(
         os.listdir("".join([self.path1, self.path2])).sort(),
         [
             "symlink_to_file",
             "context.py",
             "model_test.py",
             "symlink_to_directory",
             "recursive_symlink",
         ].sort(),
     )
예제 #4
0
파일: model_test.py 프로젝트: albanb/tribud
 def test_is_connected(self):
     directory = model.DirHandler(self.path2)
     self.assertTrue(directory.is_connected())
예제 #5
0
파일: model_test.py 프로젝트: albanb/tribud
 def test_connect(self):
     directory = model.DirHandler(self.path1)
     directory.connect()
     self.assertTrue(os.access(self.path1, os.F_OK))