summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjvoisin2014-02-01 15:44:24 +0000
committerjvoisin2014-02-01 15:44:24 +0000
commit7f308642294d9b68cda8eba9c2ffb5f14f3843ff (patch)
tree548e122a605dbc4b0035eb0604c5d5ab3188b668 /test
parentd23b55231433c13c0a0e7b62ee460bfdbe8b59cd (diff)
Build some testfiles at runtime
Diffstat (limited to 'test')
-rw-r--r--test/empty_file0
-rw-r--r--test/end\nline1
-rw-r--r--test/libtest.py8
3 files changed, 3 insertions, 6 deletions
diff --git a/test/empty_file b/test/empty_file
deleted file mode 100644
index e69de29..0000000
--- a/test/empty_file
+++ /dev/null
diff --git a/test/end\nline b/test/end\nline
deleted file mode 100644
index 35b4964..0000000
--- a/test/end\nline
+++ /dev/null
@@ -1 +0,0 @@
1I am a nasty file with a \n in my name.
diff --git a/test/libtest.py b/test/libtest.py
index c2cb2f1..fdef091 100644
--- a/test/libtest.py
+++ b/test/libtest.py
@@ -73,17 +73,15 @@ class TestFileAttributes(unittest.TestCase):
73 ''' 73 '''
74 test various stuffs about files (readable, writable, exist, ...) 74 test various stuffs about files (readable, writable, exist, ...)
75 ''' 75 '''
76 def test_not_writtable(self):
77 ''' test MAT's behaviour on non-writable file'''
78 self.assertFalse(MAT.mat.create_class_file('not_writtable', False, add2archive=True))
79
80 def test_not_exist(self): 76 def test_not_exist(self):
81 ''' test MAT's behaviour on non-existent file''' 77 ''' test MAT's behaviour on non-existent file'''
82 self.assertFalse(MAT.mat.create_class_file('ilikecookies', False, add2archive=True)) 78 self.assertFalse(MAT.mat.create_class_file('non_existent_file', False, add2archive=True))
83 79
84 def test_empty(self): 80 def test_empty(self):
85 ''' test MAT's behaviour on empty file''' 81 ''' test MAT's behaviour on empty file'''
82 open('empty_file', 'a').close()
86 self.assertFalse(MAT.mat.create_class_file('empty_file', False, add2archive=True)) 83 self.assertFalse(MAT.mat.create_class_file('empty_file', False, add2archive=True))
84 os.remove('empty_file')
87 85
88 86
89class TestSecureRemove(unittest.TestCase): 87class TestSecureRemove(unittest.TestCase):