Show More
@@ -191,18 +191,22 b' class TestContentsManager(TestCase):' | |||||
191 |
|
191 | |||
192 | # Create a sub-sub directory to test getting directory contents with a |
|
192 | # Create a sub-sub directory to test getting directory contents with a | |
193 | # subdir. |
|
193 | # subdir. | |
194 |
s |
|
194 | self.make_dir('foo/bar') | |
195 | self.make_dir(sub_sub_dir_path) |
|
|||
196 |
|
195 | |||
197 | dirmodel = cm.get('foo') |
|
196 | dirmodel = cm.get('foo') | |
198 | self.assertEqual(dirmodel['type'], 'directory') |
|
197 | self.assertEqual(dirmodel['type'], 'directory') | |
199 | self.assertIsInstance(dirmodel['content'], list) |
|
198 | self.assertIsInstance(dirmodel['content'], list) | |
200 | self.assertEqual(len(dirmodel['content']), 2) |
|
199 | self.assertEqual(len(dirmodel['content']), 2) | |
|
200 | self.assertEqual(dirmodel['path'], 'foo') | |||
|
201 | self.assertEqual(dirmodel['name'], 'foo') | |||
201 |
|
202 | |||
202 | # Directory contents should match the contents of each individual entry |
|
203 | # Directory contents should match the contents of each individual entry | |
203 | # when requested with content=False. |
|
204 | # when requested with content=False. | |
204 | model2_no_content = cm.get(sub_dir + name, content=False) |
|
205 | model2_no_content = cm.get(sub_dir + name, content=False) | |
205 |
sub_sub_dir_no_content = cm.get( |
|
206 | sub_sub_dir_no_content = cm.get('foo/bar', content=False) | |
|
207 | self.assertEqual(sub_sub_dir_no_content['path'], 'foo/bar') | |||
|
208 | self.assertEqual(sub_sub_dir_no_content['name'], 'bar') | |||
|
209 | ||||
206 | for entry in dirmodel['content']: |
|
210 | for entry in dirmodel['content']: | |
207 | # Order isn't guaranteed by the spec, so this is a hacky way of |
|
211 | # Order isn't guaranteed by the spec, so this is a hacky way of | |
208 | # verifying that all entries are matched. |
|
212 | # verifying that all entries are matched. |
General Comments 0
You need to be logged in to leave comments.
Login now