Conversation
all except cipher
| # your code here | ||
| pass | ||
| def test_None(self): | ||
| self.assertTrue(questions.is_unique_string(None)) |
There was a problem hiding this comment.
is_unique_string expects string as input, not None
| def test_if_return_string(self): | ||
| self.assertIsInstance(questions.reverse_words_concatenation(['x', 'y', 'z']), str) | ||
|
|
||
| def tes_str(self): |
There was a problem hiding this comment.
function name must starts with test_
| def test_not_unique(self): | ||
| self.assertFalse(questions.is_unique_string('aabbcc')) | ||
|
|
||
| def tes_unique(self): |
There was a problem hiding this comment.
function name must starts with test_
| self.assertFalse(questions.prime_number(0)) | ||
|
|
||
| def test_none(self): | ||
| self.assertFalse(questions.prime_number(None)) |
There was a problem hiding this comment.
prime_number should receive only int as an argument
| self.assertFalse(questions.prime_number(None)) | ||
|
|
||
| def test_float(self): | ||
| self.assertFalse(questions.prime_number(5.5)) |
There was a problem hiding this comment.
prime_number should receive only int as an argument
| def test_sample(self): | ||
| # your code here | ||
| pass | ||
| def negative_vaules(self): |
There was a problem hiding this comment.
Test function must starts with test_
| def negative_vaules(self): | ||
| men = {"John": -20, "Abraham": -45} | ||
| women = {"July": -18, "Kim": -26} | ||
| result = ('John', 'July') |
There was a problem hiding this comment.
aren't ('July', 'John') a valid result as well?
| result = ('John', 'July') | ||
| self.assertEqual(questions.pair_match(men, women), result) | ||
|
|
||
| def is_result_tuple(self): |
There was a problem hiding this comment.
Test function must starts with test_
| women = {"July": -18, "Kim": -26} | ||
| self.assertIsInstance(questions.pair_match(men,women), tuple) | ||
|
|
||
| def none_value(self): |
There was a problem hiding this comment.
Test function must starts with test_
| women = {"July": None, "Kim": -26} | ||
| self.assertEqual(questions.pair_match(men,women), ('Abraham', 'Kim')) | ||
|
|
||
| def none_key(self): |
There was a problem hiding this comment.
Test function must starts with test_
| women = {"July": 55, "Kim": 256} | ||
| self.assertEqual(questions.pair_match(men,women), (None, 'Kim')) | ||
|
|
||
| def zero_values(self): |
There was a problem hiding this comment.
Test function must starts with test_
| self.assertEqual(questions.bad_average(20, 40, 40), 33) | ||
|
|
||
| def test_float(self): | ||
| self.assertEqual(questions.bad_average(5.5, 5.5, 5.5), 5) |
| self.assertEqual(questions.bad_average(5.5, 5.5, 5.5), 5) | ||
|
|
||
| def test_return_int(self): | ||
| self.assertIsInstance(questions.bad_average(0, 0, 0), int) |
There was a problem hiding this comment.
float is a valid response type as well
| data = { | ||
| "Ben": 78, | ||
| "Dan": 88, | ||
| "Nathan": None, |
There was a problem hiding this comment.
The function expects dict of str -> int | float. So no need to test this case
|
|
||
| def test_value_string(self): | ||
| data = { | ||
| None: 'x', |
There was a problem hiding this comment.
The function expects dict of str -> int | float. So no need to test this case
| } | ||
| self.assertEqual(questions.best_student(data), 'Tal') | ||
|
|
||
| def test_key_not_str(self): |
There was a problem hiding this comment.
The function expects dict of str -> int | float. So no need to test this case
| self.assertEqual(questions.best_student(data), 'Tal') | ||
|
|
||
|
|
||
| class TestPrintDictAsTable(unittest.TestCase): |
There was a problem hiding this comment.
We will remove this function from the katas
| def test_sample(self): | ||
| # your code here | ||
| pass | ||
| def test_negative(self): |
There was a problem hiding this comment.
n should be a natural number (positive integer)
| n = '7x' | ||
| self.assertEqual(questions.seven_boom(n), []) | ||
|
|
||
| class TestCaesarCipher(unittest.TestCase): |
There was a problem hiding this comment.
This test suite should test caesar_cipher, not sum_of_digits
alonitac
left a comment
There was a problem hiding this comment.
Hi Ilya, great job! I left some comments
Hi,
Terribly sorry for the wrong pull requests I've made a week ago. I believe that this one is correct.
Thank you in advance for the patience :)