Skip to content

Commit

Permalink
Added test if pyproject.toml exists
Browse files Browse the repository at this point in the history
  • Loading branch information
AmaseCocoa committed Aug 9, 2024
1 parent f1ab3b1 commit a81b610
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ def test_no_file(testdir: Testdir) -> None:
config = Config.load(path)
assert isinstance(config.prisma_version, str)

def test_with_file(testdir: Testdir) -> None:
"""Can works config from pyproject.toml successfully"""
path = Path('pyproject.toml')
testdir.makefile(
'.toml',
pyproject=dedent(
"""
[tool.prisma]
prisma_version = '~'
"""
),
)

assert path.exists()
config = Config.load(path)
assert config.home_dir == '~'

def test_loading(testdir: Testdir) -> None:
"""Config loading overrides defaults"""
Expand Down

0 comments on commit a81b610

Please sign in to comment.