summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-11-23 22:28:13 +0100
committerhut <hut@lavabit.com>2009-11-23 22:28:13 +0100
commitfe179145892d5835b33c79ab90b6ba257cf5f12d (patch)
treeebcd72f666500a2c824c26825b3c7048eca4f363 /test
parent4f2df30807d145ff78ca7db8ca5601187e1f6e03 (diff)
downloadranger-fe179145892d5835b33c79ab90b6ba257cf5f12d.tar.gz
test cases for directory.py
Diffstat (limited to 'test')
-rw-r--r--test/tc_directory.py67
-rw-r--r--test/testdir/largefile.txt1
-rw-r--r--test/testdir/zerobytes0
3 files changed, 68 insertions, 0 deletions
diff --git a/test/tc_directory.py b/test/tc_directory.py
new file mode 100644
index 00000000..b0a4b780
--- /dev/null
+++ b/test/tc_directory.py
@@ -0,0 +1,67 @@
+import unittest
+import sys, os
+sys.path.append('../code')
+import directory
+
+TESTDIR = os.path.realpath(os.path.join(os.path.dirname(sys.argv[0]), 'testdir'))
+NONEXISTANT_DIR = '/this/directory/will/most/certainly/not/exist'
+
+class Test1(unittest.TestCase):
+	def testInitialCondition(self):
+		# Check for the expected initial condition
+		dir = directory.Directory(TESTDIR)
+
+		self.assertEqual(dir.path, TESTDIR)
+		self.assertFalse(dir.files_loaded)
+		self.assertEqual(dir.files, None)
+		self.assertRaises(directory.NotLoadedYet, len, dir)
+		self.assertRaises(directory.NotLoadedYet, dir.__getitem__, 0)
+
+	def testAfterFilesLoaded(self):
+		# Check whether the directory has the correct list of files.
+		dir = directory.Directory(TESTDIR)
+		dir.load_files()
+
+		self.assertTrue(dir.exists)
+		self.assertEqual(type(dir.files), list)
+
+		# Get the files you expect it to have and sort both before
+		# comparing. I don't expect any order after only loading the files.
+		assumed_files = os.listdir(TESTDIR)
+		assumed_files.sort()
+		dir.files.sort()
+
+		self.assertTrue(len(dir) > 0)
+		self.assertEqual(dir.files, assumed_files)
+
+	def testNonexistantDir(self):
+		dir = directory.Directory(NONEXISTANT_DIR)
+		dir.load_files()
+		
+		self.assertTrue(dir.files_loaded)
+		self.assertFalse(dir.exists)
+		self.assertFalse(dir.accessible)
+		self.assertEqual(dir.files, None)
+		self.assertRaises(directory.NotLoadedYet, len, dir)
+		self.assertRaises(directory.NotLoadedYet, dir.__getitem__, 0)
+
+	def testModifyFrozenClone(self):
+		dir = directory.Directory(TESTDIR)
+		clone = dir.frozenClone()
+
+		# assert that their attributes are equal, except for frozen, which
+		# should be true for the clone.
+		self.assertTrue(clone.frozen)
+		clone.frozen = False
+		self.assertEqual(dir.__dict__, clone.__dict__)
+		clone.frozen = True
+
+		# check for inequality after loading files with one object
+		self.assertEqual(dir.files, clone.files)
+		dir.load_files()
+		self.assertNotEqual(dir.files, clone.files)
+
+		self.assertRaises(directory.FrozenException, clone.load_files)
+
+unittest.main()
+
diff --git a/test/testdir/largefile.txt b/test/testdir/largefile.txt
new file mode 100644
index 00000000..0eb8c64f
--- /dev/null
+++ b/test/testdir/largefile.txt
@@ -0,0 +1 @@
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
diff --git a/test/testdir/zerobytes b/test/testdir/zerobytes
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/testdir/zerobytes
^
1ed9af83 ^







5f128523 ^

8e7827df ^
5f128523 ^
9a31c34f ^



5f128523 ^
e709c65e ^




9a31c34f ^

1ed9af83 ^
4d6b5173 ^
1ed9af83 ^



9a31c34f ^
1ed9af83 ^

9a31c34f ^
5f128523 ^
9a31c34f ^

5f128523 ^
9a31c34f ^









5f128523 ^
9a31c34f ^
5f128523 ^
9a31c34f ^







5f128523 ^
9a31c34f ^


5f128523 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179