-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10e58bc
commit 41f3f11
Showing
6 changed files
with
47 additions
and
77 deletions.
There are no files selected for viewing
51 changes: 2 additions & 49 deletions
51
kata-solutions/christmas-tree/christmas-tree-python/poetry.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,10 @@ authors = ["Zeger Hendrikse <[email protected]>"] | |
|
||
[tool.poetry.dependencies] | ||
python = ">=3.10.0,<=3.13" | ||
mamba = "^0.11.2" | ||
expects = "^0.9.0" | ||
pytest-watch = "^4.2.0" | ||
coverage = "^7.6.3" | ||
pyhamcrest = "^2.1.0" | ||
pytest = "^8.3.3" | ||
|
||
[tool.poetry.dev-dependencies] | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
kata-solutions/christmas-tree/christmas-tree-python/run_tests.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
PYTHONPATH=src poetry run mamba --format=documentation test/tree_spec.py --enable-coverage && poetry run coverage html | ||
poetry run pytest |
2 changes: 1 addition & 1 deletion
2
kata-solutions/christmas-tree/christmas-tree-python/run_watch.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
PYTHONPATH=src poetry run ptw --runner="poetry run mamba --format=documentation --enable-coverage test/tree_spec.py" | ||
poetry run ptw |
24 changes: 0 additions & 24 deletions
24
kata-solutions/christmas-tree/christmas-tree-python/test/tree_spec.py
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
kata-solutions/christmas-tree/christmas-tree-python/test/tree_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import pytest | ||
from hamcrest import * | ||
|
||
def christmas_tree(height): | ||
if height == 1: | ||
return ["*", | ||
"|"] | ||
elif height == 2: | ||
return [" *", | ||
"***", | ||
" |"] | ||
elif height ==3: | ||
return [" *", | ||
" ***", | ||
"*****", | ||
" |"] | ||
return ["|"] | ||
|
||
class TestChristmasTree: | ||
|
||
def test_a_new_ChristmasTree_0(self): | ||
assert_that(christmas_tree(0), | ||
equal_to(["|"])) | ||
|
||
def test_a_new_ChristmasTree_1(self): | ||
assert_that(christmas_tree(1), | ||
equal_to(["*", | ||
"|"])) | ||
|
||
def test_a_new_ChristmasTree_2(self): | ||
assert_that(christmas_tree(2), | ||
equal_to([" *", | ||
"***", | ||
" |"])) | ||
|
||
def test_a_new_ChristmasTree_3(self): | ||
assert_that(christmas_tree(3), | ||
equal_to([" *", | ||
" ***", | ||
"*****", | ||
" |"])) | ||
|