A selenium style testing library for console applications
Project description
Hecate is a Python 3 library for testing command line interfaces that make interesting use of the terminal, e.g. through ncurses. Unlike tools like expect or pexpect it runs a full blown terminal emulator (specifically, tmux) behind the scenes, so you can take accurate snapshots of what your application would look like when run by a real user.
Usage
Hecate is currently shall we say lightly documented (this is a euphemism for undocumented). However the tests should work tolerably well as usage examples and there are reasonable docstrings on the implementation.
Frequently Anticipated Questions
Are you serious?
Not very, no. As a concept it works and works well, and I’m fully prepared to maintain this if it proves popular, but this should be considered a semi experimental hack which just happens to be orders of magnitude better than all of the for serious mature projects you could be using instead.
On the other hand the last time I wrote a semi-experimental testing hack that just happened to be the best around (in Python), we got Hypothesis, so…
Will you support Python 2.7?
No.
Why not?
Because you shouldn’t need it and I don’t want to. Hecate scripts are stand alone applications that interact with your program through its terminal interface. You can easily test things written in any language you like, including other versions of Python.
What versions of tmux does it support?
My CI tests it on versions 1.6 through 2.0, so that’s the officially supported set. It probably works on earlier ones but I haven’t tested and am not very interested in doing so.
Why is it called Hecate?
It seemed appropriate to name a Selenium style tool for curses based applications after a goddess whose domain includes the moon and magic.
How does it work?
Behind the scenes Hecate is spawning a tmux instance and running your command with it along with a monitoring process so that we can report back the exit code (after all, who would make a testing framework that didn’t report the standard mechanism for indicating errors back to you?). Hecate interacts with the tmux server using its command line tools.
I might update it to use the control protocol at some point, but it so far doesn’t seem that useful to do so and that would limit the range of supported tmux versions or require a lot of version specific code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file hecate-0.1.0.tar.gz
.
File metadata
- Download URL: hecate-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33ae7e357767851ab7267685595be516e6ccdc868e00d9ca9fc44becb70b8d21 |
|
MD5 | 74baa666a0712307374452adf26a743b |
|
BLAKE2b-256 | c1a7ed1cfa8d9439201de560742bd36dd2718d8892124fc0d4df8e2c3b71759e |