This repository has been archived by the owner on Mar 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
57 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
omit = charlatan/_compat.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ fixture1: | |
fields: | ||
foo: bar | ||
|
||
|
||
fixture2: | ||
fields: | ||
foo: !rel fixture1 | ||
|
Empty file.
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,9 @@ | ||
import pytest | ||
|
||
from charlatan import file_format | ||
|
||
|
||
def test_non_yaml_file(): | ||
"""Verify that we can't open a non-YAML file.""" | ||
with pytest.raises(ValueError): | ||
file_format.load_file("./charlatan/tests/data/test.json") |
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,31 @@ | ||
import pytest | ||
|
||
from charlatan import FixturesManager | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def collection(): | ||
"""Return FixtureCollection.""" | ||
|
||
manager = FixturesManager() | ||
manager.load("docs/examples/collection.yaml") | ||
return manager.fixture_collection.get("toasters")[0] | ||
|
||
|
||
def test_repr(collection): | ||
"""Verify the repr.""" | ||
assert repr(collection) == "<DictFixtureCollection 'toasters'>" | ||
|
||
|
||
def test_cant_get_invalid_format(collection): | ||
"""Verify that we can't get an invalid format.""" | ||
|
||
with pytest.raises(ValueError): | ||
collection.get_all_instances(format="invalid") | ||
|
||
|
||
def test_cant_get_missing_fixture(collection): | ||
"""Verify that we can't get a missing fixture.""" | ||
|
||
with pytest.raises(KeyError): | ||
collection.get("missing") |
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