diff --git a/python/pyproject.toml b/python/pyproject.toml new file mode 100644 index 00000000..2bf1ac81 --- /dev/null +++ b/python/pyproject.toml @@ -0,0 +1,3 @@ +[tool.pytest.ini_options] +pythonpath = ["."] +addopts = ["--ignore=tests/test_gilded_rose_approvals.py"] diff --git a/python/tests/test_gilded_rose.py b/python/tests/test_gilded_rose.py index 1c92f638..33e19e86 100644 --- a/python/tests/test_gilded_rose.py +++ b/python/tests/test_gilded_rose.py @@ -1,15 +1,21 @@ # -*- coding: utf-8 -*- +import sys import unittest +from pathlib import Path + +_EXERCISE_ROOT = Path(__file__).resolve().parent.parent +if str(_EXERCISE_ROOT) not in sys.path: + sys.path.insert(0, str(_EXERCISE_ROOT)) from gilded_rose import Item, GildedRose class GildedRoseTest(unittest.TestCase): - def test_foo(self): + def test_normal_item_at_zero_quality_stays_zero(self): items = [Item("foo", 0, 0)] gilded_rose = GildedRose(items) gilded_rose.update_quality() - self.assertEqual("fixme", items[0].name) + self.assertEqual(0, items[0].quality) if __name__ == '__main__':