Skip to content

Commit

Permalink
refactor: Use 1-based indexing in VCR cassettes
Browse files Browse the repository at this point in the history
To have it consistent with JUnit
  • Loading branch information
Stranger6667 committed Apr 27, 2020
1 parent d4ec6a6 commit edd0c78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/schemathesis/cli/cassettes.py
Expand Up @@ -137,7 +137,7 @@ def get_command_representation() -> str:

def worker(file_handle: click.utils.LazyFile, queue: Queue) -> None:
"""Write YAML to a file in an incremental manner."""
current_id = 0
current_id = 1
stream = file_handle.open()
dumper = StringDumper(stream, sort_keys=False) # type: ignore
StringSerializer.__init__(dumper) # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions test/cli/test_cassettes.py
Expand Up @@ -25,8 +25,8 @@ def test_store_cassette(cli, schema_url, cassette_path):
assert result.exit_code == ExitCode.OK
cassette = load_cassette(cassette_path)
assert len(cassette["http_interactions"]) == 3
assert cassette["http_interactions"][0]["id"] == "0"
assert cassette["http_interactions"][1]["id"] == "1"
assert cassette["http_interactions"][0]["id"] == "1"
assert cassette["http_interactions"][1]["id"] == "2"
assert cassette["http_interactions"][0]["status"] == "SUCCESS"
assert cassette["http_interactions"][0]["seed"] == "1"
assert float(cassette["http_interactions"][0]["elapsed"]) >= 0
Expand Down

0 comments on commit edd0c78

Please sign in to comment.