[Resistor Color Expert]: Corrected Small Typos (#3469)
* Corrected small typos around resistor bands. * Due to failing CI, alterations to the test generator script were needed. The generated vs submitted diff now skips the first three lines of the file so that the generation date is not picked up and flagged as needing regeneration. Sadly, a workaround was also needed to prevent Python difflib from noting the difference anyways and producing an empty "false positive" diff. All templates and test files also needed to be altered to ensure that the first three lines of every test file will always be the autogeneration comment and date. Hopefully, this will now stop the CI failures without creating any subtle additional bugs. * Touch up to bowling template. Added back the error raising utility. * Touch up to two-bucket template to add back in error raising utility. [no important files changed]
This commit is contained in:
@@ -261,6 +261,19 @@ def format_file(path: Path) -> NoReturn:
|
||||
|
||||
|
||||
def check_template(slug: str, tests_path: Path, tmpfile: Path):
|
||||
"""Generate a new test file and diff against existing file.
|
||||
|
||||
Note: The timestamp in each test file creates issues with
|
||||
Python difflib, so it is skipped when being prepped
|
||||
for diff.
|
||||
|
||||
You can see this "skipping" on lines 281 & 283.
|
||||
However, this rather crude method creates
|
||||
an empty "false positive" diff. This empty diff is
|
||||
then skipped in lines 293 & 294, so that it can be
|
||||
considered a pass..
|
||||
"""
|
||||
|
||||
try:
|
||||
check_ok = True
|
||||
if not tmpfile.is_file():
|
||||
@@ -271,24 +284,25 @@ def check_template(slug: str, tests_path: Path, tmpfile: Path):
|
||||
check_ok = False
|
||||
if check_ok and not filecmp.cmp(tmpfile, tests_path):
|
||||
with tests_path.open() as f:
|
||||
for line in range(4):
|
||||
next(f)
|
||||
current_lines = f.readlines()
|
||||
current_lines = f.readlines()[3:]
|
||||
with tmpfile.open() as f:
|
||||
for line in range(4):
|
||||
next(f)
|
||||
rendered_lines = f.readlines()
|
||||
diff = difflib.unified_diff(
|
||||
rendered_lines = f.readlines()[3:]
|
||||
|
||||
diff = list(difflib.unified_diff(
|
||||
current_lines,
|
||||
rendered_lines,
|
||||
fromfile=f"[current] {tests_path.name}",
|
||||
tofile=f"[generated] {tmpfile.name}",
|
||||
)
|
||||
logger.debug(f"{slug}: ##### DIFF START #####")
|
||||
for line in diff:
|
||||
logger.debug(line.strip())
|
||||
logger.debug(f"{slug}: ##### DIFF END #####")
|
||||
check_ok = False
|
||||
lineterm="\n",
|
||||
))
|
||||
if not diff:
|
||||
check_ok = True
|
||||
else:
|
||||
logger.debug(f"{slug}: ##### DIFF START #####")
|
||||
for line in diff:
|
||||
logger.debug(line.strip())
|
||||
logger.debug(f"{slug}: ##### DIFF END #####")
|
||||
check_ok = False
|
||||
if not check_ok:
|
||||
logger.error(
|
||||
f"{slug}: check failed; tests must be regenerated with bin/generate_tests.py"
|
||||
|
||||
31
config/complexnumbers_template.j2
Normal file
31
config/complexnumbers_template.j2
Normal file
@@ -0,0 +1,31 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
import math
|
||||
{{ macros.header(imports=imports, ignore=ignore) }}
|
||||
|
||||
{%- macro test_cases_recursive(cases) -%}
|
||||
{% for case in cases -%}
|
||||
{% if "cases" in case %}
|
||||
# {{ case["description"] }}
|
||||
{{ test_cases_recursive(case["cases"]) }}
|
||||
{% else %}
|
||||
{{ test_case(case) }}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% endmacro %}
|
||||
|
||||
{% if not additional_tests -%}
|
||||
{%- macro additional_tests() -%}
|
||||
{{ test_cases_recursive(additional_cases) }}
|
||||
{% endmacro %}
|
||||
{%- endif %}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{{ test_cases_recursive(cases) }}
|
||||
|
||||
{% if additional_cases | length -%}
|
||||
# Additional tests for this track
|
||||
{{ additional_tests() }}
|
||||
{%- endif %}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro header(imports=[], ignore=[]) -%}
|
||||
{{ canonical_ref() }}
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -38,14 +37,6 @@ from {{ exercise | to_snake }} import ({% if imports -%}
|
||||
return self.assertRaisesRegex(exception, r".+")
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro footer(_has_error_case) -%}
|
||||
{% if has_error_case or _has_error_case %}
|
||||
{{ utility() }}
|
||||
{% endif %}
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro empty_set(set, list, class_name) -%}
|
||||
{%- if list|length > 0 -%}
|
||||
{{ set }} = {{ class_name }}({{ list }})
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(imports=imports, ignore=ignore) }}
|
||||
|
||||
{%- macro test_cases_recursive(cases) -%}
|
||||
@@ -25,4 +27,3 @@ class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
# Additional tests for this track
|
||||
{{ additional_tests() }}
|
||||
{%- endif %}
|
||||
{{ macros.footer() }}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{% macro test_case(case) -%}
|
||||
{%- set input = case["input"] -%}
|
||||
@@ -8,7 +11,7 @@
|
||||
"{{ case["expected"] }}"
|
||||
)
|
||||
{%- endmacro %}
|
||||
{{ macros.header()}}
|
||||
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/acronym/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{% macro test_supercase(supercase) %}
|
||||
{% for case in supercase["cases"] -%}
|
||||
@@ -25,8 +28,6 @@ def test_{{ case["description"] | to_snake }}(self):
|
||||
{% endif -%}
|
||||
{%- endmacro %}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for supercase in cases -%}
|
||||
{{ test_supercase(supercase) }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/affine-cipher/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{%- macro func_call(case) -%}
|
||||
{{ case["property"] }}(
|
||||
@@ -22,8 +25,6 @@
|
||||
{%- endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
{{ test_case(case) }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/all-your-base/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(imports=[ exercise | camel_case ]) }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/allergies/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/alphametics/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/anagram/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/armstrong-numbers/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/atbash-cipher/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["BankAccount"]) }}
|
||||
{% macro test_case(case) -%}
|
||||
def test_{{ case["description"] | to_snake }}(self):
|
||||
account = BankAccount()
|
||||
@@ -36,7 +39,6 @@
|
||||
{%- endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{{ macros.header(["BankAccount"]) }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/bank-account/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/beer-song/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{%- macro build_tree(tree_obj) -%}
|
||||
{{ macros.header (imports=["BinarySearchTree", "TreeNode"]) }}
|
||||
|
||||
{% macro build_tree(tree_obj) %}
|
||||
{%- if tree_obj is none -%}
|
||||
None
|
||||
{%- else -%}
|
||||
@@ -25,8 +28,6 @@ TreeNode("{{ tree_obj["data"] }}",
|
||||
self.{{ assertion }}(BinarySearchTree({{ tree_data }}).{{ prop | to_snake }}(),expected)
|
||||
{%- endmacro -%}
|
||||
|
||||
{{ macros.header (imports=["BinarySearchTree", "TreeNode"]) }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{%- for case in cases %}
|
||||
{%- if "cases" in case %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/binary-search-tree/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
{%- macro test_call(case) %}
|
||||
{{ case["property"] }}(
|
||||
{{ case["input"]["array"] }},
|
||||
{{ case["input"]["value"] }}
|
||||
)
|
||||
{% endmacro -%}
|
||||
{% endmacro %}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/binary-search/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases %}
|
||||
def test_{{ case["description"] | to_snake }}(self):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/bob/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
{% macro test_case(case) -%}
|
||||
{%- set input = case["input"] -%}
|
||||
def test_{{ case["description"] | to_snake }}(self):
|
||||
basket = {{ input["basket"] }}
|
||||
self.assertEqual({{ case["property"] }}(basket), {{ case["expected"] }})
|
||||
{%- endmacro %}
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/book-store/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/bottle-song/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["BowlingGame"]) }}
|
||||
|
||||
{% macro test_case(case) -%}
|
||||
{%- set input = case["input"] -%}
|
||||
def test_{{ case["description"] | to_snake }}(self):
|
||||
@@ -16,7 +20,6 @@
|
||||
self.assertEqual(game.score(), {{ case["expected"] }})
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
{{ macros.header(["BowlingGame"]) }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
def roll_new_game(self, rolls):
|
||||
@@ -29,5 +32,4 @@ class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{{ test_case(case) }}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{{ macros.footer() }}
|
||||
{{ macros.utility() }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/bowling/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-21
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -211,7 +211,3 @@ class BowlingTest(unittest.TestCase):
|
||||
# Utility functions
|
||||
def assertRaisesWithMessage(self, exception):
|
||||
return self.assertRaisesRegex(exception, r".+")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.header() }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/change/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["CircularBuffer","BufferEmptyException", "BufferFullException"]) }}
|
||||
|
||||
{% macro call_op(op) -%}
|
||||
buf.{{ op["operation"] }}(
|
||||
{% if "item" in op -%}
|
||||
@@ -6,7 +10,7 @@ buf.{{ op["operation"] }}(
|
||||
{%- endif -%}
|
||||
)
|
||||
{%- endmacro -%}
|
||||
{{ macros.header(["CircularBuffer","BufferEmptyException", "BufferFullException"]) }}
|
||||
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/circular-buffer/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["Clock"])}}
|
||||
|
||||
{%- macro clock(obj) -%}
|
||||
Clock({{ obj["hour"] }}, {{ obj["minute"] }})
|
||||
{%- endmacro -%}
|
||||
{{ macros.header(["Clock"])}}
|
||||
|
||||
{% set cases = additional_cases + cases %}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/clock/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{% macro test_case(case) -%}
|
||||
def test_{{ case["description"] | to_snake }}(self):
|
||||
{% set expected = case["expected"] -%}
|
||||
@@ -15,7 +19,6 @@
|
||||
)
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
{{ macros.header() }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/collatz-conjecture/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-20
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import math
|
||||
{% extends "complexnumbers_template.j2" %}
|
||||
|
||||
{% extends "master_template.j2" -%}
|
||||
{%- set imports = ["ComplexNumber"] -%}
|
||||
{% set imports = ["ComplexNumber"] %}
|
||||
|
||||
{%- macro translate_math(item) -%}
|
||||
{{ item | replace("pi", "math.pi") | replace("e", "math.e") | replace("ln", "math.log") }}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import math
|
||||
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/complex-numbers/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import math
|
||||
import unittest
|
||||
|
||||
from complex_numbers import (
|
||||
@@ -191,7 +190,3 @@ class ComplexNumbersTest(unittest.TestCase):
|
||||
|
||||
def test_inequality_of_imaginary_part(self):
|
||||
self.assertNotEqual(ComplexNumber(1, 2), ComplexNumber(1, 1))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/connect/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -110,7 +110,3 @@ class ConnectTest(unittest.TestCase):
|
||||
)
|
||||
winner = game.get_winner()
|
||||
self.assertEqual(winner, "X")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(['cipher_text']) }}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/crypto-square/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{% set class_name = exercise | camel_case -%}
|
||||
{{ macros.header([class_name]) }}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/custom-set/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.header() }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/darts/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.header() }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/diamond/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.header() }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for supercase in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/difference-of-squares/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{% set class = exercise | camel_case -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["private_key", "public_key", "secret"]) }}
|
||||
|
||||
{% set class = exercise | camel_case -%}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
{% set property = case["property"] | to_snake -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/diffie-hellman/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["Character", "modifier"]) }}
|
||||
|
||||
{% macro test_case(supercase) -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/dnd-character/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{% macro tuplify(dominoes_list) -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/dominoes/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{% macro test_case(case) -%}
|
||||
{%- set input = case["input"] -%}
|
||||
def test_{{ case["description"] | to_snake }}(self):
|
||||
@@ -9,7 +13,6 @@
|
||||
{{ case["property"] | to_snake }}(legacy_data), data
|
||||
)
|
||||
{%- endmacro %}
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/etl/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.header() }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/flatten-array/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.header() }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/food-chain/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{% set imports = ["evaluate", "StackUnderflowError"] %}
|
||||
{{ macros.header(imports=imports, ignore=ignore) }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(imports = ["evaluate", "StackUnderflowError"])}}
|
||||
|
||||
{% macro test_case(group, case) -%}
|
||||
def test_{{ group | to_snake }}_{{ case["description"] | to_snake }}(self):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/forth/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
from datetime import datetime
|
||||
{{ macros.header() }}
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
from datetime import datetime
|
||||
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/gigasecond/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
from datetime import datetime
|
||||
import unittest
|
||||
|
||||
from gigasecond import (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/go-counting/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
@@ -85,11 +85,3 @@ class GoCountingTest(unittest.TestCase):
|
||||
self.assertSetEqual(territories[BLACK], {(0, 0), (2, 0)})
|
||||
self.assertSetEqual(territories[WHITE], set())
|
||||
self.assertSetEqual(territories[NONE], set())
|
||||
|
||||
# Utility functions
|
||||
def assertRaisesWithMessage(self, exception):
|
||||
return self.assertRaisesRegex(exception, r".+")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["School"]) }}
|
||||
|
||||
{%- macro test_case( case) -%}
|
||||
{%- set input = case["input"] -%}
|
||||
{%- set property = case["property"] -%}
|
||||
@@ -15,8 +19,7 @@
|
||||
{% else %}
|
||||
self.assertEqual(school.{{ case["property"] | to_snake }}(), expected)
|
||||
{%- endif %}
|
||||
{% endmacro -%}
|
||||
{{ macros.header(["School"]) }}
|
||||
{% endmacro %}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/grade-school/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{% macro test_case(case) %}
|
||||
{%- set input = case["input"] %}
|
||||
@@ -16,8 +19,6 @@
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
{%- if "cases" in case -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/grains/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.header() }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
import io
|
||||
{{ macros.header()}}
|
||||
from unittest import mock
|
||||
|
||||
{% set filenames = comments | join("\n") | regex_find("[a-z-]*\.txt") -%}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/grep/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import io
|
||||
import unittest
|
||||
|
||||
from grep import (
|
||||
grep,
|
||||
)
|
||||
import io
|
||||
from unittest import mock
|
||||
|
||||
FILE_TEXT = {
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{%- macro test_call(case) %}
|
||||
{{ case["property"] }}(
|
||||
{% for arg in case["input"].values() -%}
|
||||
"{{ arg }}"{{ "," if not loop.last }}
|
||||
{% endfor %}
|
||||
)
|
||||
{% endmacro -%}
|
||||
{{ macros.header() }}
|
||||
{% endmacro %}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/hamming/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/hello-world/canonical-data.json
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
try:
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["HighScores"]) }}
|
||||
|
||||
{%- macro get_property(property) %}
|
||||
{%- if property == "scores" %}
|
||||
scores
|
||||
@@ -19,10 +23,7 @@
|
||||
highscores.personal_{{ function }}()
|
||||
self.assertEqual(highscores.{{ get_property(property) }}, expected)
|
||||
{% endif -%}
|
||||
{% endmacro -%}
|
||||
|
||||
{{ macros.header(["HighScores"]) }}
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{%- for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/high-scores/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/house/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header() }}
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/isbn-verifier/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{%- macro test_call(case) %}
|
||||
{{ case["property"] | to_snake }}(
|
||||
{% for arg in case["input"].values() -%}
|
||||
"{{ arg }}"{{ "," if not loop.last }}
|
||||
{% endfor %}
|
||||
)
|
||||
{% endmacro -%}
|
||||
{{ macros.header() }}
|
||||
{% endmacro %}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{# All test cases in this exercise are nested, so use two for loops -#}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/isogram/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{% macro test_case(case) -%}
|
||||
{%- set input = case["input"] -%}
|
||||
def test_{{ case["description"] | to_snake }}(self):
|
||||
@@ -8,7 +12,6 @@
|
||||
{{ case["input"]["cage"]["exclude"] }}),
|
||||
{{ case["expected"] }})
|
||||
{%- endmacro %}
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases[0]["cases"] -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/killer-sudoku-helper/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header(["Garden"]) }}
|
||||
|
||||
{%- macro test_case(group_name, case) -%}
|
||||
{%- set input = case["input"] -%}
|
||||
def test_{{ group_name | to_snake }}_
|
||||
@@ -16,8 +20,7 @@
|
||||
"{{ val | camel_case }}"{{- "," if not loop.last }}
|
||||
{% endfor %}]
|
||||
)
|
||||
{% endmacro -%}
|
||||
{{ macros.header(["Garden"]) }}
|
||||
{% endmacro %}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for casegroup in cases %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/kindergarten-garden/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.header() }}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/knapsack/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{%- import "generator_macros.j2" as macros with context -%}
|
||||
{{ macros.canonical_ref() }}
|
||||
|
||||
{{ macros.header()}}
|
||||
|
||||
{%- macro test_call(case) -%}
|
||||
{{ case["property"] | to_snake }}("{{ case["input"]["digits"] }}", {{ case["input"]["span"] }})
|
||||
{%- endmacro -%}
|
||||
|
||||
{{ macros.header() }}
|
||||
{%- endmacro %}
|
||||
|
||||
class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{% for case in cases -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# These tests are auto-generated with test data from:
|
||||
# https://github.com/exercism/problem-specifications/tree/main/exercises/largest-series-product/canonical-data.json
|
||||
# File last updated on 2023-07-16
|
||||
# File last updated on 2023-07-19
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user