Skip to main content

Console tool for validating the Supplier API implementation

Project description

Supplier API Testing Tool

CLI tool screenshot

Requirements

Python 3.7+

Installation

pip install supplier-api-tester

Usage

The CLI Testing Tool supports both API v1.x and v2.x. By default, the CLI runs all the tests for API v2.x.

If you wish to test your API implementation based on the v1 specification then you can pass the argument --version (or -v) in the CLI to enable v1 testing.

For more details on how to test your v1-complaint implementation please refer to the API docs for V1.

For example, the following command will test your API implementation according to the v1 specification:

supplier_products -u 'http://localhost:8000' -k 'secret' -v 1

Listing the products catalog:

supplier_products -u 'http://localhost:8000' -k 'secret' -v 2

A300-FX
ID: A300-FX
Timeslots: yes
Refundable: yes
Cutoff time: 24
Provides Pricing: yes

A400-FX
ID: A400-FX
Timeslots: yes
Refundable: no
Cutoff time: 0
Required Additional Order Data: pickup_location, passport_id
Required Additional Visitors Data: full_name, phone
Provides Pricing: no

A500-FX
ID: A500-FX
Timeslots: no
Refundable: yes
Cutoff time: 0
Required Additional Order Data: pickup_location, passport_id, flight_number
Provides Pricing: yes

A550-FX
ID: A550-FX
Timeslots: no
Refundable: yes
Cutoff time: 10
Required Additional Visitors Data: email, date_of_birth
Provides Pricing: no

A600-FX
ID: A600-FX
Timeslots: no
Refundable: no
Cutoff time: 0
Required Additional Order Data: nationality
Provides Pricing: no

Products found: 5

Testing tool usage:

supplier_tester --help
Usage: supplier_tester [OPTIONS]

  Test your Supplier API implementation

Options:
  -u, --url TEXT         [required]
  -k, --api-key TEXT     [required]
  -p, --product-id TEXT  Product ID to call tests on. Required with -a and -t flags
  -t, --timeslots        Use timeslots
  -a, --availability     Run availability tests
  -r, --reservation      Run reservation tests
  -b, --booking          Run booking tests
  -c, --catalog          Run product catalog tests
  -nc, --no-colors       Not using colors on output
  -v, --version          Choosing the API version
  --help                 Show this message and exit

Running all tests:

supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -v 2

Running only availability tests:

supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -a -v 2

Test example:

supplier_tester -u 'http://localhost:8000' -k 'secret' -p 'A500-FX' -v 2

──────────────────
AVAILABILITY TESTS
──────────────────

█  # 1 [ 12ms] Checking availability for the next 30 days  # 2 [  4ms] Request without API-Key  # 3 [  3ms] Request with incorrect API-Key  # 4 [  9ms] Testing missing argument errors  # 5 [  3ms] Testing availability for non existing product  # 6 [  7ms] Checking incorrect date format  # 7 [  3ms] Checking incorrect range error  # 8 [  3ms] Checking past date  # 9 [128ms] Checking huge date range  #10 [ 10ms] Testing optional price attribute in availability

─────────────────
RESERVATION TESTS
─────────────────

█  # 1 [  5ms] Request without API-Key  # 2 [  4ms] Request with incorrect API-Key  # 3 [ 20ms] Testing missing argument errors  # 4 [ 17ms] Reserving tickets for at least 1 variant  # 5 [ 13ms] Testing reservation for non-existing product  # 6 [ 15ms] Testing reservation with incorrect date format  # 7 [ 15ms] Testing reservation with past date  # 8 [ 16ms] Testing reservation for product with provide_pricing=True

─────────────
BOOKING TESTS
─────────────

█  # 1 [  3ms] Booking without the reservation ID  # 2 [  2ms] Booking without the API key  # 3 [  3ms] Booking with incorrect API-Key  # 4 [  2ms] Booking with incorrect reservation ID.  # 5 [ 19ms] Booking tickets for at least 1 variant  # 6 [ 30ms] Perform booking that will be cancelled

───────────────
PRODUCT CATALOG
───────────────

█  # 1 [  3ms] Get product catalog  Note that Tiqets will send the main booker’s name, email address and phone number with each reservation. Requiring ADDITIONAL customer data either at the order level (required_order_data ) and/or for each individual travel group member (required_visitor_data) should be done only if this is a hard requirement for the fulfillment or visitor entrance process.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supplier_api_tester-2.2.10.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

Supplier_API_tester-2.2.10-py3-none-any.whl (46.5 kB view details)

Uploaded Python 3

File details

Details for the file supplier_api_tester-2.2.10.tar.gz.

File metadata

  • Download URL: supplier_api_tester-2.2.10.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for supplier_api_tester-2.2.10.tar.gz
Algorithm Hash digest
SHA256 1ad0bb3af4bf56b47f460fc4bccf1e5428f2855ea80fe8f2172b07a048206645
MD5 d2c1647114a05fd435baaad07b337743
BLAKE2b-256 1b5f5df2d217ac6313ad02c4a4d709a26d37c15d204eaf084a761a9cba9a4036

See more details on using hashes here.

File details

Details for the file Supplier_API_tester-2.2.10-py3-none-any.whl.

File metadata

File hashes

Hashes for Supplier_API_tester-2.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 89efac3bd5ea8f6d3cbd09c0af9e8206b02e91a6c918148b1c5257705ad577f6
MD5 04fd4854df6c31a572120a7d82c85497
BLAKE2b-256 79cc8e3ef7b0475e7f76b1130ebf5d385384c5dc2921b31ccf4d11687eed9120

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page