diff options
| author | jvoisin | 2011-06-18 04:42:52 +0200 |
|---|---|---|
| committer | jvoisin | 2011-06-18 04:42:52 +0200 |
| commit | de5917e5f01374bb1a647f49ae85283241a2bea9 (patch) | |
| tree | fbe5483af79965d1445bd4aaa528f0ad3e48a8aa | |
| parent | 0523e034870ed80cc3916ebb78552d661de4d3b0 (diff) | |
Creation of the arborescence
| -rw-r--r-- | __init__.py | 0 | ||||
| -rwxr-xr-x | cli.py | 2 | ||||
| -rw-r--r-- | hachoir_editor/__init__.pyc | bin | 603 -> 0 bytes | |||
| -rw-r--r-- | hachoir_editor/field.pyc | bin | 3690 -> 0 bytes | |||
| -rw-r--r-- | hachoir_editor/fieldset.pyc | bin | 14654 -> 0 bytes | |||
| -rw-r--r-- | hachoir_editor/typed_field.pyc | bin | 11745 -> 0 bytes | |||
| -rw-r--r-- | lib/__init__.py | 0 | ||||
| -rwxr-xr-x | lib/mat.py (renamed from mat.py) | 9 | ||||
| -rw-r--r-- | test/__init__.py | 0 | ||||
| -rw-r--r-- | test/clean.jpg (renamed from clean.jpg) | bin | 83261 -> 83261 bytes | |||
| -rwxr-xr-x | test/clitest.py (renamed from clitest.py) | 17 | ||||
| -rw-r--r-- | test/dirty.jpg (renamed from dirty.jpg) | bin | 83261 -> 83261 bytes | |||
| -rwxr-xr-x | test/libtest.py (renamed from libtest.py) | 4 | ||||
| -rwxr-xr-x | test/test.py (renamed from test.py) | 4 |
14 files changed, 21 insertions, 15 deletions
diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/__init__.py | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | ''' | 4 | ''' |
| 5 | 5 | ||
| 6 | import sys | 6 | import sys |
| 7 | import mat | 7 | import lib.mat |
| 8 | import optparse | 8 | import optparse |
| 9 | 9 | ||
| 10 | __version__ = '0.1' | 10 | __version__ = '0.1' |
diff --git a/hachoir_editor/__init__.pyc b/hachoir_editor/__init__.pyc deleted file mode 100644 index 23f4a8e..0000000 --- a/hachoir_editor/__init__.pyc +++ /dev/null | |||
| Binary files differ | |||
diff --git a/hachoir_editor/field.pyc b/hachoir_editor/field.pyc deleted file mode 100644 index ff7b91d..0000000 --- a/hachoir_editor/field.pyc +++ /dev/null | |||
| Binary files differ | |||
diff --git a/hachoir_editor/fieldset.pyc b/hachoir_editor/fieldset.pyc deleted file mode 100644 index f4e37fa..0000000 --- a/hachoir_editor/fieldset.pyc +++ /dev/null | |||
| Binary files differ | |||
diff --git a/hachoir_editor/typed_field.pyc b/hachoir_editor/typed_field.pyc deleted file mode 100644 index 3d442ed..0000000 --- a/hachoir_editor/typed_field.pyc +++ /dev/null | |||
| Binary files differ | |||
diff --git a/lib/__init__.py b/lib/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lib/__init__.py | |||
| @@ -3,18 +3,19 @@ | |||
| 3 | ''' | 3 | ''' |
| 4 | Metadata anonymisation toolkit library | 4 | Metadata anonymisation toolkit library |
| 5 | ''' | 5 | ''' |
| 6 | import sys | ||
| 7 | import os | ||
| 6 | 8 | ||
| 7 | import hachoir_core.error | 9 | import hachoir_core.error |
| 8 | import hachoir_core.field | 10 | import hachoir_core.field |
| 9 | import hachoir_core.cmd_line | 11 | import hachoir_core.cmd_line |
| 10 | import hachoir_parser | 12 | import hachoir_parser |
| 11 | import hachoir_metadata | 13 | import hachoir_metadata |
| 12 | import hachoir_editor | ||
| 13 | |||
| 14 | import sys | ||
| 15 | import os | ||
| 16 | import hachoir_parser.image | 14 | import hachoir_parser.image |
| 17 | 15 | ||
| 16 | sys.path.append('..') | ||
| 17 | import hachoir_editor | ||
| 18 | |||
| 18 | __version__ = "0.1" | 19 | __version__ = "0.1" |
| 19 | __author__ = "jvoisin" | 20 | __author__ = "jvoisin" |
| 20 | 21 | ||
diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/__init__.py | |||
diff --git a/clean.jpg b/test/clean.jpg index 09c9161..09c9161 100644 --- a/clean.jpg +++ b/test/clean.jpg | |||
| Binary files differ | |||
diff --git a/clitest.py b/test/clitest.py index edd0ddb..da0563f 100755 --- a/clitest.py +++ b/test/clitest.py | |||
| @@ -5,23 +5,24 @@ | |||
| 5 | 5 | ||
| 6 | import unittest | 6 | import unittest |
| 7 | import subprocess | 7 | import subprocess |
| 8 | 8 | import sys | |
| 9 | sys.path.append('..') | ||
| 9 | import cli | 10 | import cli |
| 10 | import mat | 11 | from lib import mat |
| 11 | import test | 12 | import test |
| 12 | 13 | ||
| 13 | class Test_Remove_cli(test.MATTest): | 14 | class Test_Remove_cli(test.MATTest): |
| 14 | def test_remove(self): | 15 | def test_remove(self): |
| 15 | '''make sure that the cli remove all compromizing meta''' | 16 | '''make sure that the cli remove all compromizing meta''' |
| 16 | for clean, dirty in self.file_list: | 17 | for clean, dirty in self.file_list: |
| 17 | subprocess.call(['./cli.py', dirty]) | 18 | subprocess.call(['../cli.py', dirty]) |
| 18 | current_file = mat.create_class_file(dirty) | 19 | current_file = mat.create_class_file(dirty) |
| 19 | self.assertTrue(current_file.is_clean()) | 20 | self.assertTrue(current_file.is_clean()) |
| 20 | 21 | ||
| 21 | def test_remove_empty(self): | 22 | def test_remove_empty(self): |
| 22 | '''Test removal with clean files''' | 23 | '''Test removal with clean files''' |
| 23 | for clean, dirty in self.file_list: | 24 | for clean, dirty in self.file_list: |
| 24 | subprocess.call(['./cli.py', clean]) | 25 | subprocess.call(['../cli.py', clean]) |
| 25 | current_file = mat.create_class_file(clean) | 26 | current_file = mat.create_class_file(clean) |
| 26 | self.assertTrue(current_file.is_clean()) | 27 | self.assertTrue(current_file.is_clean()) |
| 27 | 28 | ||
| @@ -31,7 +32,7 @@ class Test_List_cli(test.MATTest): | |||
| 31 | '''check if get_meta returns meta''' | 32 | '''check if get_meta returns meta''' |
| 32 | for clean, dirty in self.file_list: | 33 | for clean, dirty in self.file_list: |
| 33 | #fixme : a (clean|dirty).(jpg|pdf|...).out ? | 34 | #fixme : a (clean|dirty).(jpg|pdf|...).out ? |
| 34 | proc = subprocess.Popen(['./cli.py', '-d', clean], | 35 | proc = subprocess.Popen(['../cli.py', '-d', clean], |
| 35 | stdout=subprocess.PIPE) | 36 | stdout=subprocess.PIPE) |
| 36 | stdout, stderr = proc.communicate() | 37 | stdout, stderr = proc.communicate() |
| 37 | self.assertEqual(stdout, "[+] File %s" % clean) | 38 | self.assertEqual(stdout, "[+] File %s" % clean) |
| @@ -39,7 +40,7 @@ class Test_List_cli(test.MATTest): | |||
| 39 | def test_list_dirty(self): | 40 | def test_list_dirty(self): |
| 40 | '''check if get_meta returns all the expected meta''' | 41 | '''check if get_meta returns all the expected meta''' |
| 41 | for clean, dirty in self.file_list: | 42 | for clean, dirty in self.file_list: |
| 42 | proc = subprocess.Popen(['./cli.py', '-d', dirty], | 43 | proc = subprocess.Popen(['../cli.py', '-d', dirty], |
| 43 | stdout=subprocess.PIPE) | 44 | stdout=subprocess.PIPE) |
| 44 | stdout, stderr = proc.communicate() | 45 | stdout, stderr = proc.communicate() |
| 45 | self.assertNotEqual(stdout, "[+] File %s" % dirty) | 46 | self.assertNotEqual(stdout, "[+] File %s" % dirty) |
| @@ -50,7 +51,7 @@ class Test_isClean_cli(test.MATTest): | |||
| 50 | def test_clean(self): | 51 | def test_clean(self): |
| 51 | '''test is_clean on clean files''' | 52 | '''test is_clean on clean files''' |
| 52 | for clean, dirty in self.file_list: | 53 | for clean, dirty in self.file_list: |
| 53 | proc = subprocess.Popen(['./cli.py', '-c', clean], | 54 | proc = subprocess.Popen(['../cli.py', '-c', clean], |
| 54 | stdout=subprocess.PIPE) | 55 | stdout=subprocess.PIPE) |
| 55 | stdout, stderr = proc.communicate() | 56 | stdout, stderr = proc.communicate() |
| 56 | self.assertEqual(stdout.strip('\n'), '[+] %s is clean' % clean) | 57 | self.assertEqual(stdout.strip('\n'), '[+] %s is clean' % clean) |
| @@ -58,7 +59,7 @@ class Test_isClean_cli(test.MATTest): | |||
| 58 | def test_dirty(self): | 59 | def test_dirty(self): |
| 59 | '''test is_clean on dirty files''' | 60 | '''test is_clean on dirty files''' |
| 60 | for clean, dirty in self.file_list: | 61 | for clean, dirty in self.file_list: |
| 61 | proc = subprocess.Popen(['./cli.py', '-c', dirty], | 62 | proc = subprocess.Popen(['../cli.py', '-c', dirty], |
| 62 | stdout=subprocess.PIPE) | 63 | stdout=subprocess.PIPE) |
| 63 | stdout, stderr = proc.communicate() | 64 | stdout, stderr = proc.communicate() |
| 64 | self.assertEqual(stdout.strip('\n'), '[+] %s is not clean' % dirty) | 65 | self.assertEqual(stdout.strip('\n'), '[+] %s is not clean' % dirty) |
diff --git a/dirty.jpg b/test/dirty.jpg index 09c9161..09c9161 100644 --- a/dirty.jpg +++ b/test/dirty.jpg | |||
| Binary files differ | |||
diff --git a/libtest.py b/test/libtest.py index 58cc618..2bd1fa7 100755 --- a/libtest.py +++ b/test/libtest.py | |||
| @@ -4,9 +4,11 @@ | |||
| 4 | Unit test for the library | 4 | Unit test for the library |
| 5 | ''' | 5 | ''' |
| 6 | 6 | ||
| 7 | import mat | ||
| 8 | import unittest | 7 | import unittest |
| 9 | import test | 8 | import test |
| 9 | import sys | ||
| 10 | sys.path.append('..') | ||
| 11 | from lib import mat | ||
| 10 | 12 | ||
| 11 | class Test_Remove_lib(test.MATTest): | 13 | class Test_Remove_lib(test.MATTest): |
| 12 | def test_remove(self): | 14 | def test_remove(self): |
| @@ -7,9 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | import shutil | 8 | import shutil |
| 9 | import glob | 9 | import glob |
| 10 | import sys | ||
| 10 | import tempfile | 11 | import tempfile |
| 11 | import unittest | 12 | import unittest |
| 12 | import mat | 13 | sys.path.append('..') |
| 14 | from lib import mat | ||
| 13 | 15 | ||
| 14 | FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*')) | 16 | FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*')) |
| 15 | 17 | ||
