mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-13 17:49:25 +00:00
Added approvals version of python test
This commit is contained in:
1 parent
69245fd714
commit
58a991fe27
8 files changed
+52
-14
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"subdirectory": "approved_files"
|
||||
}
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import unittest
|
||||
|
||||
from gilded_rose import Item, GildedRose
|
||||
|
||||
|
||||
class GildedRoseTest(unittest.TestCase):
|
||||
def test_foo(self):
|
||||
items = [Item("foo", 0, 0)]
|
||||
gilded_rose = GildedRose(items)
|
||||
gilded_rose.update_quality()
|
||||
self.assertEqual("fixme", items[0].name)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,21 @@
|
||||
import io
|
||||
import sys
|
||||
|
||||
from approvaltests import verify
|
||||
from texttest_fixture import main
|
||||
|
||||
def test_gilded_rose_approvals():
|
||||
orig_sysout = sys.stdout
|
||||
try:
|
||||
fake_stdout = io.StringIO()
|
||||
sys.stdout = fake_stdout
|
||||
sys.argv = ["texttest_fixture.py", 30]
|
||||
main()
|
||||
answer = fake_stdout.getvalue()
|
||||
finally:
|
||||
sys.stdout = orig_sysout
|
||||
|
||||
verify(answer)
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_gilded_rose_approvals()
|
||||
Reference in new issue
Block a user