summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--__init__.py0
-rwxr-xr-xcli.py2
-rw-r--r--hachoir_editor/__init__.pycbin603 -> 0 bytes
-rw-r--r--hachoir_editor/field.pycbin3690 -> 0 bytes
-rw-r--r--hachoir_editor/fieldset.pycbin14654 -> 0 bytes
-rw-r--r--hachoir_editor/typed_field.pycbin11745 -> 0 bytes
-rw-r--r--lib/__init__.py0
-rwxr-xr-xlib/mat.py (renamed from mat.py)9
-rw-r--r--test/__init__.py0
-rw-r--r--test/clean.jpg (renamed from clean.jpg)bin83261 -> 83261 bytes
-rwxr-xr-xtest/clitest.py (renamed from clitest.py)17
-rw-r--r--test/dirty.jpg (renamed from dirty.jpg)bin83261 -> 83261 bytes
-rwxr-xr-xtest/libtest.py (renamed from libtest.py)4
-rwxr-xr-xtest/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
diff --git a/cli.py b/cli.py
index bd87409..0ba7531 100755
--- a/cli.py
+++ b/cli.py
@@ -4,7 +4,7 @@
4''' 4'''
5 5
6import sys 6import sys
7import mat 7import lib.mat
8import optparse 8import 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
diff --git a/mat.py b/lib/mat.py
index 200fc04..48b83fb 100755
--- a/mat.py
+++ b/lib/mat.py
@@ -3,18 +3,19 @@
3''' 3'''
4 Metadata anonymisation toolkit library 4 Metadata anonymisation toolkit library
5''' 5'''
6import sys
7import os
6 8
7import hachoir_core.error 9import hachoir_core.error
8import hachoir_core.field 10import hachoir_core.field
9import hachoir_core.cmd_line 11import hachoir_core.cmd_line
10import hachoir_parser 12import hachoir_parser
11import hachoir_metadata 13import hachoir_metadata
12import hachoir_editor
13
14import sys
15import os
16import hachoir_parser.image 14import hachoir_parser.image
17 15
16sys.path.append('..')
17import 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
6import unittest 6import unittest
7import subprocess 7import subprocess
8 8import sys
9sys.path.append('..')
9import cli 10import cli
10import mat 11from lib import mat
11import test 12import test
12 13
13class Test_Remove_cli(test.MATTest): 14class 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
7import mat
8import unittest 7import unittest
9import test 8import test
9import sys
10sys.path.append('..')
11from lib import mat
10 12
11class Test_Remove_lib(test.MATTest): 13class Test_Remove_lib(test.MATTest):
12 def test_remove(self): 14 def test_remove(self):
diff --git a/test.py b/test/test.py
index 3138be7..f095157 100755
--- a/test.py
+++ b/test/test.py
@@ -7,9 +7,11 @@
7 7
8import shutil 8import shutil
9import glob 9import glob
10import sys
10import tempfile 11import tempfile
11import unittest 12import unittest
12import mat 13sys.path.append('..')
14from lib import mat
13 15
14FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*')) 16FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*'))
15 17