Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnair1 committed Mar 2, 2022
1 parent ca86f68 commit a31ac2b
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 <[email protected]>"
]
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 a31ac2b

Please sign in to comment.