chitamoor / Rester

Testing RESTful APIs
MIT License
85 stars 34 forks source link

Python API for running REST tests from inside python script #17

Open asmodehn opened 8 years ago

asmodehn commented 8 years ago

Is there a clear API for this somewhere ? I was just thinking it would be useful to separate the command line interface and the python interface in case someone (me at the moment) just wants to do something like :

import rester
rester.run_test('test.json')

And document this API.

asmodehn commented 8 years ago

It could actually be nice if rester could be used from inside a nose fixture or integrate in any way with existing (python + javascript ?) test frameworks. This would make all Rester users instantly able to use all fancy tests tools, UIs and IDE while doing REST API testing.

chitamoor commented 8 years ago

Good point on the separating the command line from the python interface. I haven't tested this, but

import rester test_runner = ApiTestCaseRunner() test_runner.run_test_case(test_case_file) # invoke test case test_runner.run_test_suite(test_suite_file) # invoke test suite

should work