[Twisted-Python] How do I write AMP Command definitions TTD-edly?
![](https://secure.gravatar.com/avatar/415203f2727ceaf56d8f7f5e6d5d508b.jpg?s=120&d=mm&r=g)
Hi, I have no issue writing AMP responders TTD-edly, they work pretty much the way any other code would. However, I did notice that the only way I'd notice if my Command definitions themselves were broken were if my functional tests start failing. It would be nice if I could write unit test driven Command specifications, as well. The quickest I could come up with was to call makeArguments/makeResponse with a few known-good/known-bad dictionaries, and see if it blows up. Is there a smarter way to do it? -- cheers lvh
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Mar 4, 2013, at 8:17 AM, exarkun@twistedmatrix.com wrote:
Chris and I wrote all the AMP-using code for game TDD. See game/test/test_network.py in lp:game.
(That's <http://bazaar.launchpad.net/~game-hackers/game/trunk/view/head:/game/test/te...> for those of you not familiar with launchpad.) -g
![](https://secure.gravatar.com/avatar/415203f2727ceaf56d8f7f5e6d5d508b.jpg?s=120&d=mm&r=g)
That looks awesome. I can't find a license for it. I'm publishing some third-party helpers for twisted's amp implementation as I need them myself (presumably I'll make a formal release announcement at the Pycon sprints). Do you mind if I copy this code? I can't seem to find a license. (txampext is ISC-licensed, which I assume is congruent to your sensibilities :)) On Mon, Mar 4, 2013 at 5:17 PM, <exarkun@twistedmatrix.com> wrote:
-- cheers lvh
![](https://secure.gravatar.com/avatar/607cfd4a5b41fe6c886c978128b9c03e.jpg?s=120&d=mm&r=g)
On 5 Mar, 09:46 am, _@lvh.cc wrote:
That looks awesome.
I can't find a license for it.
The code was already MIT licensed. It's more redundantly so, now. Jean-Paul I'm publishing some third-party helpers for
![](https://secure.gravatar.com/avatar/1846c8040fcf70e9b55bb7bfcdb78bc4.jpg?s=120&d=mm&r=g)
Hi again, Sorry to drag up this old post, but I have another question. On Mon, Mar 4, 2013 at 5:17 PM, <exarkun@twistedmatrix.com> wrote:
Chris and I wrote all the AMP-using code for game TDD. See game/test/test_network.py in lp:game.
I've implemented this in txampext.commandtests: https://github.com/lvh/txampext/blob/master/txampext/commandtests.py There's one more issue I have though. The lp:game code (and now txampext) deals with arguments and responses, but not exceptions. Did you have something pleasant for that, or should I just hack the the equivalent thing together for AMP exceptions as well? cheers lvh
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Mar 4, 2013, at 8:17 AM, exarkun@twistedmatrix.com wrote:
Chris and I wrote all the AMP-using code for game TDD. See game/test/test_network.py in lp:game.
(That's <http://bazaar.launchpad.net/~game-hackers/game/trunk/view/head:/game/test/te...> for those of you not familiar with launchpad.) -g
![](https://secure.gravatar.com/avatar/415203f2727ceaf56d8f7f5e6d5d508b.jpg?s=120&d=mm&r=g)
That looks awesome. I can't find a license for it. I'm publishing some third-party helpers for twisted's amp implementation as I need them myself (presumably I'll make a formal release announcement at the Pycon sprints). Do you mind if I copy this code? I can't seem to find a license. (txampext is ISC-licensed, which I assume is congruent to your sensibilities :)) On Mon, Mar 4, 2013 at 5:17 PM, <exarkun@twistedmatrix.com> wrote:
-- cheers lvh
![](https://secure.gravatar.com/avatar/607cfd4a5b41fe6c886c978128b9c03e.jpg?s=120&d=mm&r=g)
On 5 Mar, 09:46 am, _@lvh.cc wrote:
That looks awesome.
I can't find a license for it.
The code was already MIT licensed. It's more redundantly so, now. Jean-Paul I'm publishing some third-party helpers for
![](https://secure.gravatar.com/avatar/1846c8040fcf70e9b55bb7bfcdb78bc4.jpg?s=120&d=mm&r=g)
Hi again, Sorry to drag up this old post, but I have another question. On Mon, Mar 4, 2013 at 5:17 PM, <exarkun@twistedmatrix.com> wrote:
Chris and I wrote all the AMP-using code for game TDD. See game/test/test_network.py in lp:game.
I've implemented this in txampext.commandtests: https://github.com/lvh/txampext/blob/master/txampext/commandtests.py There's one more issue I have though. The lp:game code (and now txampext) deals with arguments and responses, but not exceptions. Did you have something pleasant for that, or should I just hack the the equivalent thing together for AMP exceptions as well? cheers lvh
participants (4)
-
exarkun@twistedmatrix.com
-
Glyph
-
Laurens Van Houtven
-
Laurens Van Houtven