Commit Graph
18 Commits
Author SHA1 Message Date
uzairarslan b835c7e1da Add conjured items
Conjured items degrade twice as fast as normal ones. Matched by name
prefix so any "Conjured ..." item works, not just the Mana Cake.
Wrote the tests first, then the updater. Only the Mana Cake lines
changed in the approved output.
2026-09-24 03:21:33 +05:00
uzairarslan fc9ceaad09 Split update logic into one updater class per item type
ItemUpdater has the normal rules. Brie, backstage passes and Sulfuras
subclass it and override only what differs. GildedRose picks the right
one through updater_for. Tests and approved output unchanged.
2026-09-24 03:21:18 +05:00
uzairarslan 19011580f5 Extract constants and return early for Sulfuras
No behaviour change. Named the item strings and the 0/50 bounds, moved
the body into _update_item and return early for Sulfuras so the rest of
the ladder only deals with items that actually change.
2026-09-24 03:21:18 +05:00
uzairarslan 3809be0b03 Add unit tests for the existing rules
One test per rule from the requirements, replacing test_foo. Tier
boundaries are checked on both sides, e.g. backstage passes at 11 and 10,
so an off-by-one can't slip through. All pass against the original code
with 100% branch coverage.
2026-09-24 03:21:18 +05:00
uzairarslan 5f113a1d2f Approve current output and fix the approval test reporter
Approved the 30 day fixture output as-is so there is a baseline before
refactoring. Conjured Mana Cake is still wrong here, that changes later.

The approval test was also crashing with "no reporter configuration"
instead of showing a diff. pytest-approvaltests 0.2.4 doesn't work with
approvaltests 19, so pass PythonNativeReporter directly.
2026-09-16 13:54:27 -04:00
Peter Kofler d6407909c7 Move config to Python and remove UV lock. 2026-08-21 23:22:38 +02:00
Emily Bache 469544bd82 Update README.md with -m unittest 2025-07-17 15:44:35 +02:00
emily 58a991fe27 Added approvals version of python test 2025-06-22 17:30:00 +02:00
emily 8e9e31f9b8 Improve docs for python version 2024-06-01 10:13:32 +02:00
Jannis Mainczyk dd50681dae fix deprecated usage of assertEquals
should be assertEqual, as the other form has been deprecated since 2010 and since been removed
2024-03-01 16:42:20 +01:00
emily 4ffad014c6 Fix Python documentation 2023-11-03 16:56:46 +01:00
emily 6df86da845 tweak docs 2023-11-03 15:26:54 +01:00
emily 3fb6c60ad1 Improve Python documentation 2023-11-03 15:14:14 +01:00
Albert Villanova del Moral f2cf4ad415 Update test_gilded_rose.py 2021-02-18 23:01:21 +01:00
Peter Kofler b8233e291d Moves language specific Git ignores into language subfolders. 2018-12-02 20:31:26 +01:00
Radek Simko 4a7ffc291e Remove extra whitespaces 2015-06-27 08:08:50 +01:00
Peter Kofler 4cb34a7c73 format Python code (only whitespace changes) 2014-01-25 23:01:40 +01:00
emilybache 567c27854a Removed all the code except for the GildedRose kata from this repo 2013-06-10 14:42:41 +02:00