-
Notifications
You must be signed in to change notification settings - Fork 80
Moving setitem to the base class #1044
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,9 +220,15 @@ def test_get_none(self): | |
class TestPrepSampleReadWrite(BaseTestPrepSample): | ||
"""Tests the PrepSample class""" | ||
def test_setitem(self): | ||
"""setitem raises an error (currently not allowed)""" | ||
with self.assertRaises(QiitaDBNotImplementedError): | ||
self.tester['barcodesequence'] = 'GTCCGCAAGTTA' | ||
with self.assertRaises(QiitaDBColumnError): | ||
self.tester['column that does not exist'] = 0.3 | ||
|
||
with self.assertRaises(ValueError): | ||
self.tester['emp_status_id'] = "Error!" | ||
|
||
self.assertEqual(self.tester['center_name'], 'ANL') | ||
self.tester['center_name'] = "FOO" | ||
self.assertEqual(self.tester['center_name'], "FOO") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also needs a test for when a column has the wrong datatype, triggering the ValueError. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a great point! When I wrote the test I noticed that there is a "bug" on the code (it is just preventing a useful message, therefore quoted). I'm fixing it right now. |
||
|
||
def test_delitem(self): | ||
"""delitem raises an error (currently not allowed)""" | ||
|
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.
Can you add the ValueError raised when value and database column types are not compatible here?
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.
Done