diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-09-11 10:37:48 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-09-11 16:54:59 +0900 |
commit | b9aaf8e51a074724347d3cfb69b351918bae4b98 (patch) | |
tree | a42fc15518000dc876da8d3e1e443608a4e0def9 /testdata | |
parent | b1adb9b986f6f1b1c27cb103efbe7fa6e62ac5ef (diff) | |
download | pygerrit-b9aaf8e51a074724347d3cfb69b351918bae4b98.tar.gz |
Fix #5: Move json parsing and error handling into the event factory
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
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/invalid-json.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/testdata/invalid-json.txt b/testdata/invalid-json.txt new file mode 100644 index 0000000..f7a60bb --- /dev/null +++ b/testdata/invalid-json.txt @@ -0,0 +1,4 @@ +)]}' +{"type":"user-defined-event", + "title":"Event title", + "description":"Event description"} |