Closed
Bug 885145
Opened 13 years ago
Closed 13 years ago
Add tests for mozinfo
Categories
(Testing :: Mozbase, defect)
Testing
Mozbase
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ffledgling, Assigned: ffledgling)
Details
Attachments
(1 file)
|
3.23 KB,
patch
|
ahal
:
review+
|
Details | Diff | Splinter Review |
additional tests are required for mozinfo
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → ffledgling
| Assignee | ||
Updated•13 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•13 years ago
|
||
Patch adds tests to test handling of invalid json by the update* methods, and removes the removes redundant imports.
Attachment #765118 -
Flags: review?(jhammel)
| Assignee | ||
Updated•13 years ago
|
Attachment #765118 -
Flags: review?(jhammel) → review?(ahalberstadt)
Comment 2•13 years ago
|
||
Comment on attachment 765118 [details] [diff] [review]
Adds tests for to test handling of invalid json by update* methods
Review of attachment 765118 [details] [diff] [review]:
-----------------------------------------------------------------
::: mozinfo/tests/test.py
@@ +61,5 @@
> + handle invalid JSON"""
> + j = os.path.join(self.tempdir, "mozinfo.json")
> + with open(j, 'w') as f:
> + f.write('invalid{"json":')
> + self.assertRaises(ValueError, mozinfo.find_and_update_from_json, self.tempdir)
I don't know that this is terribly useful as the ValueError is going to get raised in "update()" anyway which we're already testing. Maybe instead we could use mock to assert that find_and_update_from_json calls update exactly once (like second example in http://www.voidspace.org.uk/python/mock/getting-started.html#mock-patching-methods).
That being said, it isn't really hurting anything either so if you want to leave it as is that's fine by me.
Attachment #765118 -
Flags: review?(ahalberstadt) → review+
Comment 3•13 years ago
|
||
It might be a decent idea to consult https://bugzilla.mozilla.org/show_bug.cgi?id=881417
Comment 4•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•