diff --git a/.env_example b/.env_example new file mode 100644 index 0000000..206fdd0 --- /dev/null +++ b/.env_example @@ -0,0 +1,2 @@ +API_HOST= +API_KEY= diff --git a/README.md b/README.md index 2660f9b..9c5fe2d 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,31 @@ with lilt.ApiClient(configuration) as api_client: ``` +## Checking Credentials + +If you would like to test your credentials using our functionality tests you can do the following. Run: + +```sh +pip show lilt-python +``` + +Navigate to the Location field and create a .env file inside the package using .env_example as a template. Fill out the API_HOST and API_KEY lines using the credentials you were given. + +Then while inside the package folder, run: + +```sh +pip install -r test-requirements.txt +``` + +Followed by: + +```sh +local_test +``` + +You should be able to see the tests run. + + ## Documentation for API Endpoints All URIs are relative to *https://api.lilt.com* diff --git a/setup.py b/setup.py index c8fccbe..d8d4a28 100644 --- a/setup.py +++ b/setup.py @@ -36,5 +36,8 @@ include_package_data=True, long_description="""\ Lilt REST API Support: https://lilt.atlassian.net/servicedesk/customer/portals The Lilt REST API enables programmatic access to the full-range of Lilt backend services including: * Training of and translating with interactive, adaptive machine translation * Large-scale translation memory * The Lexicon (a large-scale termbase) * Programmatic control of the Lilt CAT environment * Translation memory synchronization Requests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests. The base url for this REST API is `https://api.lilt.com/`. ## Authentication Requests are authenticated via REST API key, which requires the Business plan. Requests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your REST API key as both the `username` and `password`. For development, you may also pass the REST API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use. ## Quotas Our services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request. # noqa: E501 - """ + """, + entry_points = { + 'console_scripts': ['local_test=workflow_tests.local_test:main'] + } ) diff --git a/workflow_tests/local_test.py b/workflow_tests/local_test.py new file mode 100644 index 0000000..ee5dab8 --- /dev/null +++ b/workflow_tests/local_test.py @@ -0,0 +1,4 @@ +import pytest + +def main(): + retcode = pytest.main(["workflow_tests"])