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

create_server function that should create a callback server #79

Closed Jaymon closed 1 year ago

Jaymon commented 3 years ago

I only have functions for File servers and cookie servers but no callback.

Also, I need to add more comments to the servers, what does the AnyServer do? Can I do a mixed server where I could pass in files or callbacks? That would be useful and allow create_server to handle most cases

Jaymon commented 3 years ago

This is the syntax for the callback server, which I had to look at the code to figure out:

        server = testdata.CallbackServer({
            "GET": lambda *_, **__: testdata.sleep(100)
        })