diff options
author | Lars Wirzenius <liw@liw.fi> | 2010-04-25 05:54:03 +1200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2010-04-25 05:54:03 +1200 |
commit | 1448638a75aac754e71356094166739eac48b5c2 (patch) | |
tree | 2b28b2b6683486bf7fe4e2f9ab9f095faa9f61d4 /testit | |
parent | 6ea588287a64a03fa43ba05881db99a4854f6d10 (diff) | |
download | dupfiles-1448638a75aac754e71356094166739eac48b5c2.tar.gz |
Add test for two hardlinks.
Diffstat (limited to 'testit')
-rwxr-xr-x | testit | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -40,6 +40,10 @@ class TestCase(object): def create(self, name, content): file(os.path.join(self.tempdir, name), 'w').write(content) + + def hardlink(self, name, newname): + os.link(os.path.join(self.tempdir, name), + os.path.join(self.tempdir, newname)) def test(self): p = subprocess.Popen(['./dupfiles', self.tempdir], @@ -79,10 +83,19 @@ class TwoIdenticalFiles(TestCase): self.identical = ['foo', 'bar'] +class TwoHardlinksToSameContent(TestCase): + + def setUp(self): + self.create('foo', 'foo') + self.hardlink('foo', 'bar') + self.identical = [] + + def main(): klasses = [ DifferentFiles, TwoIdenticalFiles, + TwoHardlinksToSameContent, ] for klass in klasses: test = klass() |