@@ -82,7 +82,8 @@ def test_list(self):
8282 f = self .fs .open ("hello world" , "w" )
8383 f .close ()
8484
85- self .assertEqual (["mike" , "test" , "hello world" ], self .fs .list ())
85+ self .assertEqual (set (["mike" , "test" , "hello world" ]),
86+ set (self .fs .list ()))
8687
8788 def test_remove (self ):
8889 self .assertRaises (TypeError , self .fs .remove , 5 )
@@ -98,13 +99,14 @@ def test_remove(self):
9899 f = self .fs .open ("hello world" , "w" )
99100 f .write ("fly" )
100101 f .close ()
101- self .assertEqual (["mike" , "test" , "hello world" ], self .fs .list ())
102+ self .assertEqual (set (["mike" , "test" , "hello world" ]),
103+ set (self .fs .list ()))
102104 self .assertEqual (self .db .fs .files .find ().count (), 3 )
103105 self .assertEqual (self .db .fs .chunks .find ().count (), 3 )
104106
105107 self .fs .remove ("test" )
106108
107- self .assertEqual (["mike" , "hello world" ], self .fs .list ())
109+ self .assertEqual (set ( ["mike" , "hello world" ]), set ( self .fs .list () ))
108110 self .assertEqual (self .db .fs .files .find ().count (), 2 )
109111 self .assertEqual (self .db .fs .chunks .find ().count (), 2 )
110112 f = self .fs .open ("mike" )
@@ -145,8 +147,8 @@ def test_list_alt_coll(self):
145147 f .close ()
146148
147149 self .assertEqual ([], self .fs .list ())
148- self .assertEqual (["mike" , "test" , "hello world" ],
149- self .fs .list ("pymongo_test" ))
150+ self .assertEqual (set ( ["mike" , "test" , "hello world" ]) ,
151+ set ( self .fs .list ("pymongo_test" ) ))
150152
151153 def test_remove_alt_coll (self ):
152154 f = self .fs .open ("mike" , "w" , "pymongo_test" )
@@ -160,10 +162,11 @@ def test_remove_alt_coll(self):
160162 f .close ()
161163
162164 self .fs .remove ("test" )
163- self .assertEqual (["mike" , "test" , "hello world" ],
164- self .fs .list ("pymongo_test" ))
165+ self .assertEqual (set ( ["mike" , "test" , "hello world" ]) ,
166+ set ( self .fs .list ("pymongo_test" ) ))
165167 self .fs .remove ("test" , "pymongo_test" )
166- self .assertEqual (["mike" , "hello world" ], self .fs .list ("pymongo_test" ))
168+ self .assertEqual (set (["mike" , "hello world" ]),
169+ set (self .fs .list ("pymongo_test" )))
167170
168171 f = self .fs .open ("mike" , collection = "pymongo_test" )
169172 self .assertEqual (f .read (), "hi" )
@@ -204,10 +207,10 @@ def test_threaded_writes(self):
204207 self .assertEqual (f .read (), "hello" )
205208 f .close ()
206209
207- # NOTE I do recognize how gross this is. There is no good way to test the
208- # with statement because it is a syntax error in older python versions.
209- # One option would be to use eval and skip the test if it is a syntax
210- # error.
210+ # NOTE I do recognize how gross this is. There is no good way to
211+ # test the with statement because it is a syntax error in older
212+ # python versions. One option would be to use eval and skip the
213+ # test if it is a syntax error.
211214 if sys .version_info [:2 ] == (2 , 5 ):
212215 import gridfs15
213216 test_with_statement = gridfs15 .test_with_statement
0 commit comments