Initial commit. First working version.
This commit is contained in:
parent
49518efcba
commit
a074cfb914
21 changed files with 220 additions and 0 deletions
0
test/__init__.py
Normal file
0
test/__init__.py
Normal file
BIN
test/__init__.pyc
Normal file
BIN
test/__init__.pyc
Normal file
Binary file not shown.
BIN
test/__pycache__/__init__.cpython-33.pyc
Normal file
BIN
test/__pycache__/__init__.cpython-33.pyc
Normal file
Binary file not shown.
BIN
test/__pycache__/test_sweeper.cpython-33.pyc
Normal file
BIN
test/__pycache__/test_sweeper.cpython-33.pyc
Normal file
Binary file not shown.
28
test/test_sweeper.py
Normal file
28
test/test_sweeper.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env python
|
||||
# Author: Darko Poljak <darko.poljak@gmail.com>
|
||||
# License: GPLv3
|
||||
|
||||
import unittest
|
||||
from sweeper import file_dups
|
||||
import os
|
||||
|
||||
mydir = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
class TestSweeper(unittest.TestCase):
|
||||
def test_file_dups_dups(self):
|
||||
dups = file_dups([os.path.join(mydir, 'testfiles_dups')], 'md5')
|
||||
dups_exist = False
|
||||
for h, flist in dups.items():
|
||||
if len(flist) > 1:
|
||||
dups_exist = True
|
||||
self.assertTrue(dups_exist)
|
||||
|
||||
def test_file_dups_nodups(self):
|
||||
dups = file_dups([os.path.join(mydir, 'testfiles_nodups')], 'md5')
|
||||
for h, flist in dups.items():
|
||||
self.assertTrue(len(flist) == 1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
BIN
test/testfiles_dups/img1.jpg
Executable file
BIN
test/testfiles_dups/img1.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
BIN
test/testfiles_dups/img2.jpg
Executable file
BIN
test/testfiles_dups/img2.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
1
test/testfiles_dups/test1
Normal file
1
test/testfiles_dups/test1
Normal file
|
|
@ -0,0 +1 @@
|
|||
test1
|
||||
1
test/testfiles_dups/test2
Normal file
1
test/testfiles_dups/test2
Normal file
|
|
@ -0,0 +1 @@
|
|||
test2
|
||||
1
test/testfiles_dups/test3
Normal file
1
test/testfiles_dups/test3
Normal file
|
|
@ -0,0 +1 @@
|
|||
test2
|
||||
1
test/testfiles_nodups/test1
Normal file
1
test/testfiles_nodups/test1
Normal file
|
|
@ -0,0 +1 @@
|
|||
test1
|
||||
1
test/testfiles_nodups/test2
Normal file
1
test/testfiles_nodups/test2
Normal file
|
|
@ -0,0 +1 @@
|
|||
test2
|
||||
1
test/testfiles_nodups/test3
Normal file
1
test/testfiles_nodups/test3
Normal file
|
|
@ -0,0 +1 @@
|
|||
test3
|
||||
Loading…
Add table
Add a link
Reference in a new issue