Commit Graph

388 Commits

Author SHA1 Message Date
Aldo Cortesi 781592d6c0 Fix timeout test. 2012-11-18 09:34:15 +13:00
Aldo Cortesi e40482576c Add disconnect specifiers to test suite.
Fixes hangs seen in test suite with recent versions of requetss.
2012-11-18 09:04:49 +13:00
Aldo Cortesi b11260f064 Expand basic fuzzing example. 2012-11-16 15:00:15 +13:00
Aldo Cortesi 5fb31f9162 Add :u shortcut example.
Update trove specifiers, netlib dependency.
2012-11-16 14:51:31 +13:00
Aldo Cortesi af698b2fda :u belongs on Request not Response 2012-11-16 14:41:02 +13:00
Aldo Cortesi 39fcc600a6 Update changelog. 2012-11-16 14:22:20 +13:00
Aldo Cortesi ef9cbe3b25 Add u User-agent shortcut.
Usage:
    200:ua       - Shortcut "a" for Android.
    200:u"foo"   - Or a value literal

Shortcuts can be listed using the --show-uas argument to pathoc.
2012-11-16 13:46:42 +13:00
Aldo Cortesi 5d18830f71 Fix typo. 2012-11-02 14:36:19 +13:00
Aldo Cortesi 791252ac5e Examples and documentation. 2012-11-02 14:22:54 +13:00
Aldo Cortesi 3ca3e7c485 Merge branch 'master' of ssh.github.com:cortesi/pathod 2012-10-31 12:44:17 +13:00
Aldo Cortesi 27d90a3594 Bump version, update CHANGELOG 2012-10-31 12:37:11 +13:00
Aldo Cortesi 3e3c5af006 Bump version, update CHANGELOG 2012-10-31 12:32:13 +13:00
Aldo Cortesi 3f50930dc0 Use .freeze to implement the -e explain flags for pathod and pathoc.
This now prints (in pathoc) or logs (in pathod) a frozen specification that
includes an expanded record of all generated values and locations.
2012-10-31 11:34:58 +13:00
Aldo Cortesi 8c6cc8140c Fix generated values in request path specification. 2012-10-31 09:48:55 +13:00
Aldo Cortesi 0c9cfb3f38 Add a .freeze() method to all components.
This expands and freezes all randomly generated values. The message returned
can be queried for a precise spec to reproduce the message.
2012-10-31 09:32:21 +13:00
Aldo Cortesi f8df0a1e75 Add a .values method to messages, simplify a lot of stuff as a consequence. 2012-10-30 16:08:36 +13:00
Aldo Cortesi a09584b9e6 Make Message classes more self-contained. 2012-10-30 15:22:53 +13:00
Aldo Cortesi b2deb470de Extract .serve() method from message classes. 2012-10-30 14:46:18 +13:00
Aldo Cortesi 677f0e0580 Change preview_safe to return a safe copy of the current message. 2012-10-30 13:36:32 +13:00
Aldo Cortesi a1f782b543 Simplify Request/Response class hierarchy. 2012-10-30 13:28:22 +13:00
Aldo Cortesi 3e0cd6442a Add .spec methods for Request and Response objects. 2012-10-29 17:33:10 +13:00
Aldo Cortesi 747eafd107 Add a .spec method to the token ABC, and to all tokens. 2012-10-29 16:31:35 +13:00
Aldo Cortesi 8741600ce7 Refactoring: canonical storage of a message is now the sequence of tokens that defines it.
We use a set of accessor properties to ease access to tokens. We can now ditch
the .accept() methods.
2012-10-29 15:16:44 +13:00
Aldo Cortesi 882969086c Cleaup, some more ABCs. 2012-10-29 10:19:58 +13:00
Aldo Cortesi 61f8992fbf Change response spec format to code[:features]
Reason message is now specified as just another feature with the "m" mnemonic.
2012-10-28 22:18:06 +13:00
Aldo Cortesi 07560ffe30 Cleaup, ABC for Value classes. 2012-10-28 22:00:19 +13:00
Aldo Cortesi 35f37626a9 Clean up .accept() signature. 2012-10-28 17:39:58 +13:00
Aldo Cortesi 7d74f75f6d Split Code and Reason into separate _Component objects. 2012-10-28 17:07:16 +13:00
Aldo Cortesi e9af434c2b .body and .method to lazy generator instantiation.
Also introduce a _Component ABC.
2012-10-28 14:15:29 +13:00
Aldo Cortesi 9d42a06c92 Move message body to new lazy-generator scheme. 2012-10-28 12:56:08 +13:00
Aldo Cortesi f54ed69a35 Adjust serve() API. 2012-10-28 09:06:55 +13:00
Aldo Cortesi ac5aacce44 Remove check argument to serve() methods.
Refactoring means we can now do this without a callback.

Also introduce the maximum_length method that estimates the max possible
message length.
2012-10-27 17:40:22 +13:00
Aldo Cortesi 06864e5a1b Major refactoring towars separate representation of expressions and request/response service. 2012-10-27 14:00:50 +13:00
Aldo Cortesi 6174e46023 Unit test suite love: 100% coverage
Also start figuring out how to sanitize binary data in the JSON API.
2012-10-25 10:59:18 +13:00
Aldo Cortesi 173b5c596e Start moving policy checks to service-time, rather than parse-time. 2012-10-25 09:45:55 +13:00
Aldo Cortesi c684f7417d Extend Action and Value classes
- Values now know how to print their own specs
- Actions now know how to print their own specs
- Actions have a resolve_offset method that resolves relative and random offsets.
2012-10-24 11:32:53 +13:00
Aldo Cortesi e83392bfc8 Start making Action objects more sophisticated. 2012-10-05 11:23:30 +13:00
Aldo Cortesi 495daf2b64 Remove actions log and explain, preparing for a more sophisticated take on this. 2012-10-05 11:14:17 +13:00
Aldo Cortesi 2bdb5d15b9 Add a simple libpathod.pathoc example 2012-10-05 10:46:09 +13:00
Aldo Cortesi f5d5cc4988 rparse.py -> language.py 2012-10-05 10:30:32 +13:00
Aldo Cortesi d3e1f8a014 Stub out documentation changes 2012-10-04 12:17:35 +13:00
Aldo Cortesi 41f1c66772 Add -q and -r flags to pathod, logging request and respnose bytes.
- These flags also mean that a bytes log is included in the internal log
buffer.
- There's an -x flag to turn on hex dump output in the text logs (does
not affect the log buffer).
2012-10-01 12:48:26 +13:00
Aldo Cortesi 915bcfbd30 Add timeout argument to Pathod, and matching -t command-line option. 2012-10-01 12:01:02 +13:00
Aldo Cortesi 8bb81be2b0 Add pathoc -T to ignore timeouts.
Also move -c to -C for consistency.
2012-09-28 11:38:49 +12:00
Aldo Cortesi 65108ed429 Add pathoc -o, oneshot mode, exits after the first non-ignored response. 2012-09-27 10:56:06 +12:00
Aldo Cortesi 7209a75201 Add pathoc -c to specify a list of return codes to ignore. 2012-09-27 09:44:25 +12:00
Aldo Cortesi 10a19fc4da Refactor print_requests -> print_request
- Change to handle one request at a time
- Shift error handling around
2012-09-26 14:25:39 +12:00
Aldo Cortesi 424d15c28b Expand the docs to explain pathoc multiple requests. 2012-09-26 11:21:40 +12:00
Aldo Cortesi b67d99638a Response printing
Options to output full response, as sniffed from the socket.
2012-09-26 11:07:22 +12:00
Aldo Cortesi a69d602087 Hex and verbatim output of requests.
This works by sniffing traffic through the socket, so always gives us the exact
traffic sent upstream.
2012-09-26 10:38:47 +12:00