Skip to content

Commit

Permalink
Synced exercise tests to problem specifications. (#3579)
Browse files Browse the repository at this point in the history
  • Loading branch information
BethanyG authored Dec 27, 2023
1 parent c9c67a8 commit ca3f65e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
5 changes: 5 additions & 0 deletions exercises/practice/ledger/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ description = "credit and debit"

[502c4106-0371-4e7c-a7d8-9ce33f16ccb1]
description = "multiple entries on same date ordered by description"
include = false

[29dd3659-6c2d-4380-94a8-6d96086e28e1]
description = "final order tie breaker is change"
Expand All @@ -41,3 +42,7 @@ description = "Dutch negative number with 3 digits before decimal point"

[29670d1c-56be-492a-9c5e-427e4b766309]
description = "American negative number with 3 digits before decimal point"

[9c70709f-cbbd-4b3b-b367-81d7c6101de4]
description = "multiple entries on same date ordered by description"
reimplements = "502c4106-0371-4e7c-a7d8-9ce33f16ccb1"
34 changes: 17 additions & 17 deletions exercises/practice/ledger/ledger_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/ledger/canonical-data.json
# File last updated on 2023-07-19
# File last updated on 2023-12-27

import unittest

Expand Down Expand Up @@ -54,22 +54,6 @@ def test_credit_and_debit(self):
)
self.assertEqual(format_entries(currency, locale, entries), expected)

def test_multiple_entries_on_same_date_ordered_by_description(self):
currency = "USD"
locale = "en_US"
entries = [
create_entry("2015-01-02", "Get present", 1000),
create_entry("2015-01-01", "Buy present", -1000),
]
expected = "\n".join(
[
"Date | Description | Change ",
"01/01/2015 | Buy present | ($10.00)",
"01/02/2015 | Get present | $10.00 ",
]
)
self.assertEqual(format_entries(currency, locale, entries), expected)

def test_final_order_tie_breaker_is_change(self):
currency = "USD"
locale = "en_US"
Expand Down Expand Up @@ -171,3 +155,19 @@ def test_american_negative_number_with_3_digits_before_decimal_point(self):
]
)
self.assertEqual(format_entries(currency, locale, entries), expected)

def test_multiple_entries_on_same_date_ordered_by_description(self):
currency = "USD"
locale = "en_US"
entries = [
create_entry("2015-01-01", "Get present", 1000),
create_entry("2015-01-01", "Buy present", -1000),
]
expected = "\n".join(
[
"Date | Description | Change ",
"01/01/2015 | Buy present | ($10.00)",
"01/01/2015 | Get present | $10.00 ",
]
)
self.assertEqual(format_entries(currency, locale, entries), expected)

0 comments on commit ca3f65e

Please sign in to comment.