summaryrefslogtreecommitdiff
path: root/unittests.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix #5: Move json parsing and error handling into the event factoryDavid Pursehouse2013-09-111-7/+13
| | | | | | | | | | Pass the raw string into the event factory and parse it to a json object there. If the string is not valid json, generate an error event. Add a unit test for handling of invalid json on the event stream. Change-Id: I209a89fd28c3a594b71443fc106e25d58c5cc1ea
* Fix #3: Don't treat unhandled event types as errorsDavid Pursehouse2013-09-111-1/+8
| | | | | | | | If an unknown event is received on the event stream, for example if a new event has been added in a later version of Gerrit, do not raise an error. Instead, generate an "UnhandledEvent" event. Change-Id: Ia1902bf4a54883011b7ad3e004f58a2ba8739b21
* Fix #4: Keep event's raw json data in the event objectDavid Pursehouse2013-09-111-1/+1
| | | | | | | | If any future versions of Gerrit add data elements that are not encapsulated by the event class, clients will be able to access them via the raw json data. Change-Id: Ia689acb808f9d200f53b86c60f024e865dd12a18
* Don't put copyright and license headers in Python module docstringsDavid Pursehouse2013-08-071-25/+23
| | | | | | | | | | | | | | If the copyright and license headers are in module docstrings, they appear in the generated API documentation pages and it looks crappy. Instead, put the headers in regular Python comments. Thus each file still has the required copyright and license notice, but it is not included everywhere in the generated documentation. The documentation still includes an automatically generated copyright notice at the bottom of each page. Change-Id: Ibc5f4ca221c0a6de26f04f3b4511d8991e28b663
* Fix pylint warningsDavid Pursehouse2013-08-061-1/+1
| | | | | | | | | | | | | | | - Add missing docstrings that the PEP-257 checker did not report. - Add explicit parameters on `GerritSSHClient.exec_command` method overridden from `paramiko.SSHClient.exec_command`. - Disable warning that the `GerritEvent` class does not have a member named `name`. This member is initialised by the event factory when a derived class is instantiated. - Capitalise constant `REQUIRES`. Change-Id: I8880e061b51e12145ee55e0cd86dab930970cde5
* Add a unit test to ensure dependency package version consistencyDavid Pursehouse2013-08-061-0/+22
| | | | | | | | Add a test to make sure that if depencency package versions are updated that they are updated to consistent versions in both requirements.txt and setup.py Change-Id: I855af3246bfb1013f8a462c99fb2d15ef6454998
* Fix hostname in unit testsDavid Pursehouse2012-10-171-1/+1
| | | | | | Change hostname "review.sonyericsson.net" to "review". Change-Id: I361873a4c9eb20e44b2c6f0642acc63bdd4e1d16
* Add license informationDavid Pursehouse2012-09-201-1/+25
| | | | Change-Id: I25ce3fafe7a51d0221f66fe30b2fb7cc8115c4aa
* Simplify the unit test structureDavid Pursehouse2012-09-201-0/+216
The structure of the unit tests, copied from another module, is overly complicated for pygerrit. Change-Id: I05d1077a624e68e72a97a4a5e3c8892768d3ad17