Skip to content

Commit

Permalink
Merge pull request #596 from sysknock/581-api-test
Browse files Browse the repository at this point in the history
Integrating API tests to Kaizen
  • Loading branch information
sauravpanda authored Oct 1, 2024
2 parents 125feb7 + 8d98d88 commit 5379fc5
Show file tree
Hide file tree
Showing 5 changed files with 4,558 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/api_test/api-main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from kaizen.generator.api_test import APITestGenerator

generator = APITestGenerator()

generator.generate_tests(
file_path="./examples/api_test/api-schema.json",
base_url="http://api.weatherbit.io/v2.0/",
enable_critique=True,
verbose=True,
max_critique=1
)

test_results = generator.run_tests()

for file_path, result in test_results.items():
print(f"Results for {file_path}:")
if "error" in result:
print(f" Error: {result['error']}")
else:
print(f" Tests run: {result.get('tests_run', 'N/A')}")
print(f" Failures: {result.get('failures', 'N/A')}")
print(f" Errors: {result.get('errors', 'N/A')}")
print()

Loading

0 comments on commit 5379fc5

Please sign in to comment.