-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GridFS.get raises NoFile if file is not found #163
Conversation
CI failure ( |
Updated PR to use |
(I've deleted my comment abount |
Well now it's optimized ^^ ! |
I've added fix from #161 to make this PR pass the unit tests |
@@ -258,7 +265,9 @@ def test_GridFsObjects(self): | |||
conn = yield txmongo.MongoConnection(mongo_host, mongo_port) | |||
db = conn.test | |||
gfs = GridFS(db) # Default collection | |||
_ = yield gfs.get("test_3") | |||
# Missing file raises error | |||
with self.assertRaises(NoFile): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, assertRaises()
can be used as context manager only with Twisted ≥ 15 :(
Please rewrite it as yield self.assertFailure(gfs.get("test_3"), NoFile)
I've changed the PR ;-) |
Looks good, thanks! |
👍 |
As talked in #160
I've also corrected missing
yield
indb.fs.files.remove({})
which lead to concurrency errors