Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnair1 committed Apr 5, 2022
1 parent 9634294 commit 9df4582
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/console/commands/plugin/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,38 @@ def test_add_with_git_constraint_with_extras(
)


def test_add_with_git_constraint_with_subdirectory(
app: PoetryTestApplication,
repo: TestRepository,
tester: CommandTester,
env: MockEnv,
installed: Repository,
):
repo.add_package(Package("pendulum", "2.0.5"))

tester.execute("git+https://github.com/demo/poetry-plugin2.git#subdirectory=subdir")

expected = """\
Updating dependencies
Resolving dependencies...
Writing lock file
Package operations: 2 installs, 0 updates, 0 removals
• Installing pendulum (2.0.5)
• Installing poetry-plugin (0.1.2 9cf87a2)
"""

assert_plugin_add_result(
tester,
app,
env,
expected,
{"git": "https://github.com/demo/poetry-plugin2.git", "subdirectory": "subdir"},
)


def test_add_existing_plugin_warns_about_no_operation(
app: PoetryTestApplication,
repo: TestRepository,
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.poetry]
name = "poetry-plugin"
version = "0.1.2"
description = "Some description."
authors = [
"Sébastien Eustace <sebastien@eustace.io>"
]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.6"
pendulum = "^2.0"
tomlkit = {version = "^0.7.0", optional = true}

[tool.poetry.extras]
foo = ["tomlkit"]

[tool.poetry.dev-dependencies]

0 comments on commit 9df4582

Please sign in to comment.