Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added ci/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions ci/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hello():
return "world"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ packages = [
{include = "example/message", from = "components"},
{include = "example/schema", from = "components"},
{include = "development"},
{include = "ci"},
]

[tool.poetry.dependencies]
Expand Down
24 changes: 21 additions & 3 deletions test/components/example/dictionaries/test_core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
from example.dictionaries import core
from example.dictionaries.core import omit, pick

from ci.utils import hello

def test_sample():
assert core is not None

def test_pick(fake_data):
assert pick(fake_data, {"good"}) == {"good": ["morning", "day", "afternoon"]}


def test_omit(fake_data):
assert omit(fake_data, {"good"}) == {"hello": "world"}


def test_environment_customization(set_some_environment_variables):
import os

data = os.getenv("HELLO")

assert data == "world"


def test_shared_code():
assert hello() == "world"
11 changes: 11 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest


@pytest.fixture
def set_some_environment_variables(monkeypatch):
monkeypatch.setenv("HELLO", "world")


@pytest.fixture
def fake_data():
return {"hello": "world", "good": ["morning", "day", "afternoon"]}