Commit Graph

30 Commits

Author SHA1 Message Date
Maximilian Hils
e0d376381e fix windows compatibility 2013-12-16 04:47:29 +01:00
Maximilian Hils
0382b809ea always read files in binary mode 2013-06-16 00:30:13 +02:00
Aldo Cortesi
110a8bb594 Print pathod craft explanations to stdout. 2013-03-03 16:33:50 +13:00
Aldo Cortesi
af698b2fda :u belongs on Request not Response 2012-11-16 14:41:02 +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
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
f5d5cc4988 rparse.py -> language.py 2012-10-05 10:30:32 +13:00