summaryrefslogtreecommitdiff
path: root/obnam
diff options
context:
space:
mode:
authorLars Wirzenius <liw@gytha>2008-03-24 17:59:45 +0200
committerLars Wirzenius <liw@gytha>2008-03-24 17:59:45 +0200
commit6188b33be571b8c322bfb93f67afb345ba8f6b54 (patch)
tree635df615c05705fe77cf57a27a8b9be6c4165985 /obnam
parent7d1b186e5f4a575b7f4ae62197c8c5cf38d32789 (diff)
downloadobnam-6188b33be571b8c322bfb93f67afb345ba8f6b54.tar.gz
Only store basenames in file group objects.
Diffstat (limited to 'obnam')
-rw-r--r--obnam/app.py2
-rw-r--r--obnam/appTests.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/obnam/app.py b/obnam/app.py
index e4bdd171..96448584 100644
--- a/obnam/app.py
+++ b/obnam/app.py
@@ -196,7 +196,7 @@ class Application:
contref = None
sigref = None
deltaref = None
- fg.add_file(filename, st, contref, sigref, deltaref)
+ fg.add_file(os.path.basename(filename), st, contref, sigref, deltaref)
def make_filegroups(self, filenames):
"""Make list of new FILEGROUP objects.
diff --git a/obnam/appTests.py b/obnam/appTests.py
index 0c09f5ea..24a982fb 100644
--- a/obnam/appTests.py
+++ b/obnam/appTests.py
@@ -138,6 +138,11 @@ class ApplicationMakeFileGroupsTests(unittest.TestCase):
filenames = self.tempfiles[:obnam.app.MAX_PER_FILEGROUP + 1]
self.failUnlessEqual(len(self.app.make_filegroups(filenames)), 2)
+ def testUsesJustBasenames(self):
+ list = self.app.make_filegroups(self.tempfiles[:1])
+ fg = list[0]
+ self.failIf("/" in fg.get_names()[0])
+
class ApplicationFindFileByNameTests(unittest.TestCase):
@@ -212,7 +217,6 @@ class ApplicationBackupsOneDirectoryTests(unittest.TestCase):
self.failUnlessEqual(len(dir.get_filegrouprefs()),
self._filegroups(len(files)))
-
def testWithCorrectNumberOfDirrefsWhenSomeAreGiven(self):
os.mkdir(self.abs("pink"))
os.mkdir(self.abs("pretty"))