Skip to content

Commit

Permalink
~ fix tests #2
Browse files Browse the repository at this point in the history
  • Loading branch information
hemnstill committed Nov 21, 2023
1 parent 4308b78 commit 1274da9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
26 changes: 18 additions & 8 deletions poetry/test_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if [[ $is_ubuntu_os == true ]]; then
apt install -y clang libmysqlclient-dev
fi

readme_content='test readme content'

pyproject_content='
[tool.poetry]
name = "StandaloneTools"
Expand All @@ -30,14 +32,16 @@ Resolving dependencies...
Package operations: 6 installs, 0 updates, 0 removals
• Installing certifi (2023.5.7)
• Installing charset-normalizer (3.1.0)
• Installing certifi (2023.11.17)
• Installing charset-normalizer (3.3.2)
• Installing idna (3.4)
• Installing urllib3 (1.26.16)
• Installing urllib3 (1.26.18)
• Installing mysqlclient (2.1.1)
• Installing requests (2.28.2)
Writing lock file'
Writing lock file
Installing the current project: StandaloneTools (1.0.0)'

test_version() {
assertEquals "Poetry (version 1.7.1)" "$(../bin/poetry.sh --version)"
Expand All @@ -51,18 +55,21 @@ test_version_plugins() {
Dependencies
- poetry (>=1.2.0,<2.0.0)
• poetry-plugin-export (1.4.0) Poetry plugin to export the dependencies to various formats
• poetry-plugin-export (1.6.0) Poetry plugin to export the dependencies to various formats
1 application plugin
Dependencies
- poetry (>=1.5.0,<2.0.0)
- poetry-core (>=1.6.0,<2.0.0)" "$(../bin/poetry.sh self show plugins)"
- poetry (>=1.6.0,<2.0.0)
- poetry-core (>=1.7.0,<2.0.0)" "$(../bin/poetry.sh self show plugins)"
}

test_install_from_symlink() {
{ printf '%s' "$pyproject_content"
} > pyproject.toml

{ printf '%s' "$readme_content"
} > README.md

ln -sf "$(readlink -f ../bin/poetry.sh)" /usr/local/bin/poetry

assertEquals "$poetry_install_stdout" "$(poetry install)"
Expand All @@ -72,9 +79,12 @@ test_install_from_sh() {
{ printf '%s' "$pyproject_content"
} > pyproject.toml

{ printf '%s' "$readme_content"
} > README.md

assertEquals "Installing dependencies from lock file
No dependencies to install or update" "$(../bin/poetry.sh install)"
No dependencies to install or update" "$(../bin/poetry.sh install --no-root)"
}

# Load and run shUnit2.
Expand Down
10 changes: 9 additions & 1 deletion poetry/test_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
is_windows_os=false && [[ $(uname) == Windows_NT* ]] && is_windows_os=true
is_nanoserver_os=false && $is_windows_os && [[ ! -f "C:\Windows\notepad.exe" ]] && is_nanoserver_os=true

readme_content='test readme content'

pyproject_content='
[tool.poetry]
name = "StandaloneTools"
Expand Down Expand Up @@ -35,6 +37,9 @@ test_install_from_path() {
{ printf '%s' "$pyproject_content"
} > pyproject.toml

{ printf '%s' "$readme_content"
} > README.md

path_with_poetry="$PATH;$(readlink -f ../bin)"
export PATH="$path_with_poetry"

Expand All @@ -47,9 +52,12 @@ test_install_from_bat() {
{ printf '%s' "$pyproject_content"
} > pyproject.toml

{ printf '%s' "$readme_content"
} > README.md

assertEquals "Installing dependencies from lock file
No dependencies to install or update" "$(../bin/poetry.bat install | dos2unix)"
No dependencies to install or update" "$(../bin/poetry.bat install --no-root | dos2unix)"
}

# Load and run shUnit2.
Expand Down

0 comments on commit 1274da9

Please sign in to comment.