-
Notifications
You must be signed in to change notification settings - Fork 15
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
raise exception on failed delete from database #1375
Conversation
The exception is also raised if the job does not exist. Do we want to handle this separately? |
14057f2
to
ad0a5df
Compare
@XzzX Can you add a unit test for this functionality? We already have a test for deleting jobs: |
You are already testing this, aren't you? There is a normal delete and a raise exception delete... I am confused. In my notebook there is no exception fired. |
@XzzX the current test only covers the regular delete and trying to submit the job ID as list which is not supported. There is currently no test to delete a job which no longer exists: def test_delete_item(self):
"""
Tests delete_item function
Returns:
"""
par_dict = self.add_items("BO")
key = par_dict["id"]
self.database.delete_item(key)
self.assertRaises(
Exception, self.database.delete_item, [key]
) # use only str or int
# self.assertRaises(Exception, self.database.get_item_by_id, key) # ensure item does not exist anymore |
Aaaah, you are checking for a type error. Now also the comment makes sense. Ok, got it. |
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.
Looks good to me
No description provided.