From 530b2d525825dd56c5c0110f22e17a343beacbd3 Mon Sep 17 00:00:00 2001 From: Fortrieb Date: Mon, 1 Oct 2018 17:07:44 +0200 Subject: [PATCH 1/2] Fix #1530 Update wordy test to 1.2.0 --- exercises/wordy/wordy_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exercises/wordy/wordy_test.py b/exercises/wordy/wordy_test.py index d44ecaee49..5260262770 100644 --- a/exercises/wordy/wordy_test.py +++ b/exercises/wordy/wordy_test.py @@ -2,8 +2,8 @@ from wordy import calculate +# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0 -# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0 class WordyTest(unittest.TestCase): def test_addition(self): @@ -51,12 +51,14 @@ def test_multiple_division(self): calculate("What is -12 divided by 2 divided by -3?"), 2) def test_unknown_operation(self): - with self.assertRaisesWithMessage(ValueError): + with self.assertRaisesWithMessage(ValueError) as error: calculate("What is 52 cubed?") + self.assertEqual("unknown operation", str(error.exception)) def test_non_math_question(self): - with self.assertRaisesWithMessage(ValueError): + with self.assertRaisesWithMessage(ValueError) as error: calculate("Who is the President of the United States?") + self.assertEqual("unknown operation", str(error.exception)) # Additional tests for this track From 442a1d5b3a178bb2ea4bfd5a44be152b498066fa Mon Sep 17 00:00:00 2001 From: Fortrieb Date: Mon, 1 Oct 2018 18:07:03 +0200 Subject: [PATCH 2/2] Removed duplicate error message checks. Spacing arround reference fixed --- exercises/wordy/wordy_test.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/wordy/wordy_test.py b/exercises/wordy/wordy_test.py index 5260262770..abbd1a0304 100644 --- a/exercises/wordy/wordy_test.py +++ b/exercises/wordy/wordy_test.py @@ -2,8 +2,8 @@ from wordy import calculate -# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0 +# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0 class WordyTest(unittest.TestCase): def test_addition(self): @@ -51,14 +51,12 @@ def test_multiple_division(self): calculate("What is -12 divided by 2 divided by -3?"), 2) def test_unknown_operation(self): - with self.assertRaisesWithMessage(ValueError) as error: + with self.assertRaisesWithMessage(ValueError): calculate("What is 52 cubed?") - self.assertEqual("unknown operation", str(error.exception)) def test_non_math_question(self): - with self.assertRaisesWithMessage(ValueError) as error: + with self.assertRaisesWithMessage(ValueError): calculate("Who is the President of the United States?") - self.assertEqual("unknown operation", str(error.exception)) # Additional tests for this track