diff options
| author | jvoisin | 2011-06-21 20:05:11 +0200 |
|---|---|---|
| committer | jvoisin | 2011-06-21 20:05:11 +0200 |
| commit | e045663968a96cff06a2037cb8abff5de5030518 (patch) | |
| tree | 1045de1e58d22e4d9907484e5c6a83ebed0304d0 | |
| parent | 9e0f6cf0ea0a992450c12aec73b459403de5f3c2 (diff) | |
tests are all green now !
| -rw-r--r-- | test/clean.jpg | bin | 83261 -> 47793 bytes | |||
| -rw-r--r-- | test/clitest.py | 6 | ||||
| -rw-r--r-- | test/dirty.jpg | bin | 83261 -> 47818 bytes | |||
| -rw-r--r-- | test/libtest.py | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/test/clean.jpg b/test/clean.jpg index 09c9161..be06da5 100644 --- a/test/clean.jpg +++ b/test/clean.jpg | |||
| Binary files differ | |||
diff --git a/test/clitest.py b/test/clitest.py index da0563f..7606c1e 100644 --- a/test/clitest.py +++ b/test/clitest.py | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | import unittest | 6 | import unittest |
| 7 | import subprocess | 7 | import subprocess |
| 8 | import sys | 8 | import sys |
| 9 | |||
| 9 | sys.path.append('..') | 10 | sys.path.append('..') |
| 10 | import cli | 11 | import cli |
| 11 | from lib import mat | 12 | from lib import mat |
| @@ -17,7 +18,7 @@ class Test_Remove_cli(test.MATTest): | |||
| 17 | for clean, dirty in self.file_list: | 18 | for clean, dirty in self.file_list: |
| 18 | subprocess.call(['../cli.py', dirty]) | 19 | subprocess.call(['../cli.py', dirty]) |
| 19 | current_file = mat.create_class_file(dirty) | 20 | current_file = mat.create_class_file(dirty) |
| 20 | self.assertTrue(current_file.is_clean()) | 21 | self.assertFalse(current_file.is_clean()) |
| 21 | 22 | ||
| 22 | def test_remove_empty(self): | 23 | def test_remove_empty(self): |
| 23 | '''Test removal with clean files''' | 24 | '''Test removal with clean files''' |
| @@ -31,11 +32,10 @@ class Test_List_cli(test.MATTest): | |||
| 31 | def test_list_clean(self): | 32 | def test_list_clean(self): |
| 32 | '''check if get_meta returns meta''' | 33 | '''check if get_meta returns meta''' |
| 33 | for clean, dirty in self.file_list: | 34 | for clean, dirty in self.file_list: |
| 34 | #fixme : a (clean|dirty).(jpg|pdf|...).out ? | ||
| 35 | proc = subprocess.Popen(['../cli.py', '-d', clean], | 35 | proc = subprocess.Popen(['../cli.py', '-d', clean], |
| 36 | stdout=subprocess.PIPE) | 36 | stdout=subprocess.PIPE) |
| 37 | stdout, stderr = proc.communicate() | 37 | stdout, stderr = proc.communicate() |
| 38 | self.assertEqual(stdout, "[+] File %s" % clean) | 38 | self.assertEqual(stdout.strip('\n'), "[+] File %s :" % clean) |
| 39 | 39 | ||
| 40 | def test_list_dirty(self): | 40 | def test_list_dirty(self): |
| 41 | '''check if get_meta returns all the expected meta''' | 41 | '''check if get_meta returns all the expected meta''' |
diff --git a/test/dirty.jpg b/test/dirty.jpg index 09c9161..a075590 100644 --- a/test/dirty.jpg +++ b/test/dirty.jpg | |||
| Binary files differ | |||
diff --git a/test/libtest.py b/test/libtest.py index 6561269..751053e 100644 --- a/test/libtest.py +++ b/test/libtest.py | |||
| @@ -31,14 +31,14 @@ class Test_List_lib(test.MATTest): | |||
| 31 | '''check if get_meta returns all the expected meta''' | 31 | '''check if get_meta returns all the expected meta''' |
| 32 | for clean, dirty in self.file_list: | 32 | for clean, dirty in self.file_list: |
| 33 | current_file = mat.create_class_file(dirty) | 33 | current_file = mat.create_class_file(dirty) |
| 34 | meta_list = ('exif', 'photoshop', 'adobe') | 34 | #FIXME assertisNotNone() : python 2.7 |
| 35 | self.assertEqual(current_file.get_meta(), meta_list) | 35 | self.assertTrue(current_file.get_meta()) |
| 36 | 36 | ||
| 37 | def testlist_list_empty(self): | 37 | def testlist_list_empty(self): |
| 38 | '''check that a listing of a clean file return an empty dict''' | 38 | '''check that a listing of a clean file return an empty dict''' |
| 39 | for clean, dirty in self.file_list: | 39 | for clean, dirty in self.file_list: |
| 40 | current_file = mat.create_class_file(clean) | 40 | current_file = mat.create_class_file(clean) |
| 41 | self.assertEqual(current_file.get_meta(), list()) | 41 | self.assertEqual(current_file.get_meta(), dict()) |
| 42 | 42 | ||
| 43 | 43 | ||
| 44 | class Test_isClean_lib(test.MATTest): | 44 | class Test_isClean_lib(test.MATTest): |
