def test_get_shared_files(self):
     document = CacheDocument()
     document.add_repository(TEST_DIR)
     document.expand_dir(abspath("data"))
     document.expand_dir(abspath(os.path.join("data", "subdir1")))
     document.share_files(abspath("data"),
                           [os.sep.join([TEST_DIR, "data", ".path"]),
                            os.sep.join([TEST_DIR, "data", ".svn"]),
                            os.sep.join([TEST_DIR, "data", "date.txt"]),
                            os.sep.join([TEST_DIR, "data", "emptydir"]),
                            os.sep.join([TEST_DIR, "data", "profiles"]),
                            os.sep.join([TEST_DIR, "data", "subdir1", ".svn"]),
                            os.sep.join([TEST_DIR, "data", "subdir1", "subsubdir"])],
                           False)
     document.share_files(abspath("data"),
                           [os.sep.join([TEST_DIR, "data"]),
                            os.sep.join([TEST_DIR, "data", ".path"]),
                            os.sep.join([TEST_DIR, "data", "date.txt"]),
                            os.sep.join([TEST_DIR, "data", "routage"]),
                            os.sep.join([TEST_DIR, "data", "subdir1"]),
                            os.sep.join([TEST_DIR, "data", "subdir1", "TOtO.txt"]),
                            os.sep.join([TEST_DIR, "data", "subdir1", "date.doc"])],
                           True)
     shared_files = [file_container.get_path() for file_container
                     in document.get_shared_files()[TEST_DIR]]
     shared_files.sort()
     self.assertEquals(shared_files, [os.sep.join([TEST_DIR, "data", ".path"]),
                                      os.sep.join([TEST_DIR, "data", "02_b_1280x1024.jpg"]),
                                      os.sep.join([TEST_DIR, "data", "Python-2.3.5.zip"]),
                                      os.sep.join([TEST_DIR, "data", "arc en ciel 6.gif"]),
                                      os.sep.join([TEST_DIR, "data", "date.txt"]),
                                      os.sep.join([TEST_DIR, "data", "pywin32-203.win32-py2.3.exe"]),
                                      os.sep.join([TEST_DIR, "data", "routage"]),
                                      os.sep.join([TEST_DIR, "data", "subdir1", "TOtO.txt"]),
                                      os.sep.join([TEST_DIR, "data", "subdir1", "date.doc"])])
 def test_get_shared_files(self):
     document = CacheDocument(PROFILE_TEST, PROFILE_DIRECTORY)
     document.add_file(REPO)
     document.expand_dir(abspath("data"))
     document.expand_dir(abspath("data/subdir1"))
     document.share_files((abspath("data"),
                           [REPO + '/data/.path',
                            REPO + '/data/.svn',
                            REPO + '/data/date.txt',
                            REPO + '/data/emptydir',
                            REPO + '/data/profiles',
                            REPO + '/data/subdir1/.svn',
                            REPO + '/data/subdir1/subsubdir'],
                           False))
     document.share_files((abspath("data"),
                           [REPO + '/data',
                            REPO + "/data/.path",
                            REPO + "/data/date.txt",
                            REPO + "/data/routage",
                            REPO + '/data/subdir1',
                            REPO + "/data/subdir1/TOtO.txt",
                            REPO + "/data/subdir1/date.doc"],
                           True))
     shared_files = [file_container.get_path() for file_container
                     in document.get_shared_files()[REPO]]
     shared_files.sort()
     self.assertEquals(shared_files, [REPO + "/data/.path",
                                      REPO + "/data/date.txt",
                                      REPO + "/data/routage",
                                      REPO + "/data/subdir1/TOtO.txt",
                                      REPO + "/data/subdir1/date.doc"])
 def test_get_shared_files(self):
     document = CacheDocument()
     document.add_repository(TEST_DIR)
     document.expand_dir(abspath("data"))
     document.expand_dir(abspath(os.path.join("data", "subdir1")))
     document.share_files(
         abspath("data"),
         [
             os.sep.join([TEST_DIR, "data", ".path"]),
             os.sep.join([TEST_DIR, "data", ".svn"]),
             os.sep.join([TEST_DIR, "data", "date.txt"]),
             os.sep.join([TEST_DIR, "data", "emptydir"]),
             os.sep.join([TEST_DIR, "data", "profiles"]),
             os.sep.join([TEST_DIR, "data", "subdir1", ".svn"]),
             os.sep.join([TEST_DIR, "data", "subdir1", "subsubdir"]),
         ],
         False,
     )
     document.share_files(
         abspath("data"),
         [
             os.sep.join([TEST_DIR, "data"]),
             os.sep.join([TEST_DIR, "data", ".path"]),
             os.sep.join([TEST_DIR, "data", "date.txt"]),
             os.sep.join([TEST_DIR, "data", "routage"]),
             os.sep.join([TEST_DIR, "data", "subdir1"]),
             os.sep.join([TEST_DIR, "data", "subdir1", "TOtO.txt"]),
             os.sep.join([TEST_DIR, "data", "subdir1", "date.doc"]),
         ],
         True,
     )
     shared_files = [file_container.get_path() for file_container in document.get_shared_files()[TEST_DIR]]
     shared_files.sort()
     self.assertEquals(
         shared_files,
         [
             os.sep.join([TEST_DIR, "data", ".path"]),
             os.sep.join([TEST_DIR, "data", "date.txt"]),
             os.sep.join([TEST_DIR, "data", "routage"]),
             os.sep.join([TEST_DIR, "data", "subdir1", "TOtO.txt"]),
             os.sep.join([TEST_DIR, "data", "subdir1", "date.doc"]),
         ],
     )