Jaymon / testdata

Python module to make testing easier, it can generate random data like names and text, run commands, fetch urls, create files and directories, and more
MIT License
10 stars 0 forks source link

Testdata serve on the command line #33

Closed Jaymon closed 3 months ago

Jaymon commented 6 years ago

Pull out our testing api code that passes through testdata stuff to the client, add a function that takes the string value and finds the function and then normalizes the input

Basically, by running 'testdata serve' on the command line you can bring up an api that will pass through what you send up to testdata and return it as json, so you have an easy way for clients to use testdata also.

Jaymon commented 5 years ago

Print out all the available commands

$ testdata --help

print out the help information (get the docblock and argument list using reflection):

$ testdata get_ascii --help

actually call something:

$ testdata create_file path="..." contents="" tmpdir="" encoding=""
$ testdata create_file "path" "contents" "tmpdir" "encodings"

It should print out what is returned, so with create_file it will return the file path.

There are certain calls that make no sense being available on the commandline like the mock_* functions, but I think this would be a really handy interface to have available