Commit de5917e5 authored by jvoisin's avatar jvoisin
Browse files

Creation of the arborescence

parent 0523e034
......@@ -4,7 +4,7 @@
'''
import sys
import mat
import lib.mat
import optparse
__version__ = '0.1'
......
......@@ -3,18 +3,19 @@
'''
Metadata anonymisation toolkit library
'''
import sys
import os
import hachoir_core.error
import hachoir_core.field
import hachoir_core.cmd_line
import hachoir_parser
import hachoir_metadata
import hachoir_editor
import sys
import os
import hachoir_parser.image
sys.path.append('..')
import hachoir_editor
__version__ = "0.1"
__author__ = "jvoisin"
......
......@@ -5,23 +5,24 @@
import unittest
import subprocess
import sys
sys.path.append('..')
import cli
import mat
from lib import mat
import test
class Test_Remove_cli(test.MATTest):
def test_remove(self):
'''make sure that the cli remove all compromizing meta'''
for clean, dirty in self.file_list:
subprocess.call(['./cli.py', dirty])
subprocess.call(['../cli.py', dirty])
current_file = mat.create_class_file(dirty)
self.assertTrue(current_file.is_clean())
def test_remove_empty(self):
'''Test removal with clean files'''
for clean, dirty in self.file_list:
subprocess.call(['./cli.py', clean])
subprocess.call(['../cli.py', clean])
current_file = mat.create_class_file(clean)
self.assertTrue(current_file.is_clean())
......@@ -31,7 +32,7 @@ class Test_List_cli(test.MATTest):
'''check if get_meta returns meta'''
for clean, dirty in self.file_list:
#fixme : a (clean|dirty).(jpg|pdf|...).out ?
proc = subprocess.Popen(['./cli.py', '-d', clean],
proc = subprocess.Popen(['../cli.py', '-d', clean],
stdout=subprocess.PIPE)
stdout, stderr = proc.communicate()
self.assertEqual(stdout, "[+] File %s" % clean)
......@@ -39,7 +40,7 @@ class Test_List_cli(test.MATTest):
def test_list_dirty(self):
'''check if get_meta returns all the expected meta'''
for clean, dirty in self.file_list:
proc = subprocess.Popen(['./cli.py', '-d', dirty],
proc = subprocess.Popen(['../cli.py', '-d', dirty],
stdout=subprocess.PIPE)
stdout, stderr = proc.communicate()
self.assertNotEqual(stdout, "[+] File %s" % dirty)
......@@ -50,7 +51,7 @@ class Test_isClean_cli(test.MATTest):
def test_clean(self):
'''test is_clean on clean files'''
for clean, dirty in self.file_list:
proc = subprocess.Popen(['./cli.py', '-c', clean],
proc = subprocess.Popen(['../cli.py', '-c', clean],
stdout=subprocess.PIPE)
stdout, stderr = proc.communicate()
self.assertEqual(stdout.strip('\n'), '[+] %s is clean' % clean)
......@@ -58,7 +59,7 @@ class Test_isClean_cli(test.MATTest):
def test_dirty(self):
'''test is_clean on dirty files'''
for clean, dirty in self.file_list:
proc = subprocess.Popen(['./cli.py', '-c', dirty],
proc = subprocess.Popen(['../cli.py', '-c', dirty],
stdout=subprocess.PIPE)
stdout, stderr = proc.communicate()
self.assertEqual(stdout.strip('\n'), '[+] %s is not clean' % dirty)
......
......@@ -4,9 +4,11 @@
Unit test for the library
'''
import mat
import unittest
import test
import sys
sys.path.append('..')
from lib import mat
class Test_Remove_lib(test.MATTest):
def test_remove(self):
......
......@@ -7,9 +7,11 @@
import shutil
import glob
import sys
import tempfile
import unittest
import mat
sys.path.append('..')
from lib import mat
FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment