-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from zalando-incubator/pytestification
Move tests outside of package (and refactor them a bit)
- Loading branch information
Showing
24 changed files
with
131 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "har-transformer" | ||
version = "1.2.3" | ||
version = "1.2.4" | ||
description = "A tool to convert HAR files into a locustfile." | ||
authors = [ | ||
"Serhii Cherniavskyi <[email protected]>", | ||
|
@@ -45,6 +45,7 @@ docs = ["sphinx", "sphinx-autodoc-typehints", "sphinx-issues"] | |
locustio = "^0.9.0" | ||
pytest = "^3.9" | ||
pytest-cov = "*" | ||
pytest-mock = "^1.10" | ||
hypothesis = "^4.4" | ||
black = {version = "*",allows-prereleases = true} | ||
flake8 = "^3.7" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import json | ||
from pytest import fixture | ||
|
||
|
||
@fixture | ||
def mock_open(mocker): | ||
return mocker.patch("builtins.open") | ||
|
||
|
||
@fixture | ||
def dummy_har_dict(): | ||
return { | ||
"log": { | ||
"entries": [ | ||
{ | ||
"startedDateTime": "2018-01-01", | ||
"request": {"method": "GET", "url": "https://www.zalando.de"}, | ||
} | ||
] | ||
} | ||
} | ||
|
||
|
||
@fixture | ||
def dummy_har_string(dummy_har_dict): | ||
return json.dumps(dummy_har_dict) | ||
|
||
|
||
@fixture | ||
def mocked_har(mocker, dummy_har_dict): | ||
j = mocker.patch("transformer.scenario.json.load") | ||
j.return_value = dummy_har_dict | ||
return j | ||
|
||
|
||
@fixture | ||
def mock_paths(mocker): | ||
mocker.patch("transformer.scenario.Path.is_dir").return_value = False | ||
mocker.patch("transformer.scenario.Path.iterdir").return_value = () | ||
mocker.patch("transformer.scenario.Path.open") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.