Skip to content

iktos/makya-api-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Makya API Test Script

This repository includes a simple command-line script (test_api.py) for testing the Makya scoring API. Its primary goal is to make it easy for developers to verify that their Makya API instance is running and producing the expected output for various SMILES string cases (valid, single, and invalid).

Purpose

  • Health Check: Verifies if the API is running and healthy.
  • Scoring Tests: Verifies if the API returns the expected number of scores for provided SMILES strings.
  • Error Handling: Checks how the API handles and reports invalid SMILES.

Usage

  1. Install dependencies
    Make sure you have requests installed:

    pip install requests

    or use the provided Poetry environment (recommended):

    poetry install
  2. Run the test script
    By default, the script will target http://localhost:5555. You can change this (and set request timeouts) using the arguments shown below.

    python test_api.py

    or use Poetry with:

    poetry run task run

    Optional arguments:

    • --api-url: Base URL of the API (default: http://localhost:5555)
    • --timeout: HTTP timeout in seconds (default: 15)

    Example:

    python test_api.py --api-url http://your-api-host:5555 --timeout 10
  3. Follow the prompt
    The script will ask you how many scores the API should return per SMILES string.

Sample Output

When the script runs successfully, you should expect output like the following:

Welcome! Let's collect a tiny bit of information before testing.
How many scores should the API return for each SMILES? 1
✅ API availability: Health endpoint responded with status 200.
✅ Multiple valid SMILES: Received 1 score(s) for each SMILES entry.
✅ Single SMILES: Received 1 score(s) for each SMILES entry.
✅ Invalid SMILES: Invalid SMILES received null scores as expected.

If a test fails, you will see a ❌ and a more detailed error message.

Extending

To add more SMILES examples, simply edit the VALID_SMILES_LIST, SINGLE_SMILES_LIST, or INVALID_SMILES_LIST variables in test_api.py. To add more use cases, follow the usage of the UseCase class to implement your own tests.

Disclaimer

This source code project is provided as an example for educational and illustrative purposes only. While efforts have been made to ensure the accuracy and reliability of the code, no guarantee is made regarding its suitability for any specific purpose.

By accessing and using this source code, you agree that:

  1. The code is provided "as is" without warranty of any kind, express or implied.
  2. You acknowledge that you are solely responsible for any consequences resulting from the use of this code.
  3. The author(s) and contributors of this code shall not be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) arising in any way out of the use of this code, even if advised of the possibility of such damage.
  4. Copyright © 2024 Iktos. All rights reserved.

This disclaimer does not limit or exclude any liability for death or personal injury resulting from negligence, fraud, or any other liability that cannot be excluded or limited under applicable law.

Use of this source code project implies acceptance of these terms.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages