python-sdk
python-sdk copied to clipboard
SpeechToTextV1.add_corpus() uses wrong http method (GET, should use POST)
Currently, using add_corpus will break with a WatsonException: Unknown error error. This is due to the method using the wrong HTTP method (GET, instead of POST). The tests don't catch this because the assertion in test_custom_corpora only checks the number of requests made and not the details of those requests.
I have a patch that should be ready soon.
After changing the test to use responses assert_all_requests_are_fired flag, test fails:
E AssertionError: Not all requests have been executed [('POST', 'https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/customid/corpora/corpus'), ('DELETE', 'https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/customid/corpora/corpus')]
env/lib/python3.5/site-packages/responses.py:304: AssertionError