From 049a2c388e388880ac45e9d1b9520fae9247a75a Mon Sep 17 00:00:00 2001 From: mRcfps <1402491442@qq.com> Date: Sun, 18 Feb 2018 20:12:40 +0800 Subject: [PATCH 1/2] all-your-base: update tests to v2.3.0 --- exercises/all-your-base/all_your_base_test.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/exercises/all-your-base/all_your_base_test.py b/exercises/all-your-base/all_your_base_test.py index a103a4d85b..022d62f73a 100644 --- a/exercises/all-your-base/all_your_base_test.py +++ b/exercises/all-your-base/all_your_base_test.py @@ -3,7 +3,7 @@ from all_your_base import rebase -# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0 +# Tests adapted from `problem-specifications//canonical-data.json` @ v2.3.0 class AllYourBaseTests(unittest.TestCase): @@ -43,15 +43,15 @@ def test_multiple_zeroes(self): def test_leading_zeros(self): self.assertEqual(rebase(7, [0, 6, 0], 10), [4, 2]) - def test_first_base_is_one(self): + def test_input_base_is_one(self): with self.assertRaisesWithMessage(ValueError): - rebase(1, [], 10) + rebase(1, [0], 10) - def test_first_base_is_zero(self): + def test_input_base_is_zero(self): with self.assertRaisesWithMessage(ValueError): rebase(0, [], 10) - def test_first_base_is_negative(self): + def test_input_base_is_negative(self): with self.assertRaisesWithMessage(ValueError): rebase(-2, [1], 10) @@ -63,15 +63,15 @@ def test_invalid_positive_digit(self): with self.assertRaisesWithMessage(ValueError): rebase(2, [1, 2, 1, 0, 1, 0], 10) - def test_second_base_is_one(self): + def test_output_base_is_one(self): with self.assertRaisesWithMessage(ValueError): rebase(2, [1, 0, 1, 0, 1, 0], 1) - def test_second_base_is_zero(self): + def test_output_base_is_zero(self): with self.assertRaisesWithMessage(ValueError): rebase(10, [7], 0) - def test_second_base_is_negative(self): + def test_output_base_is_negative(self): with self.assertRaisesWithMessage(ValueError): rebase(2, [1], -7) From ea8b2009ff6745d89fb0da901e5a6d115c985f05 Mon Sep 17 00:00:00 2001 From: mRcfps <1402491442@qq.com> Date: Sun, 18 Feb 2018 20:13:18 +0800 Subject: [PATCH 2/2] all-your-base: fit input param to canonical data in stub --- exercises/all-your-base/all_your_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/all-your-base/all_your_base.py b/exercises/all-your-base/all_your_base.py index e065fb4cb4..d0958b9db2 100644 --- a/exercises/all-your-base/all_your_base.py +++ b/exercises/all-your-base/all_your_base.py @@ -1,2 +1,2 @@ -def rebase(from_base, digits, to_base): +def rebase(input_base, digits, output_base): pass