コード例 #1
0
 def test_case_with_three_numbers(self):
     """
     test the case with the number 111
     there is only one combination: '111'
     """
     result = telephone_word_combos('111')
     self.assertEqual(result,['111'])
コード例 #2
0
    def test_case_with_max_number_mutables(self):
        """
        test the case with the number 222-2222

        should yeild a result with 3**7 combinations
        """
        result = telephone_word_combos('2222222')
        self.assertEqual(len(result), 3**7)
コード例 #3
0
    def test_case_with_two_mutables(self):
        """
        test the case with the number 111-1123

        should yeild '11111[ABC][DEF]', 9 combinations
        """
        result = telephone_word_combos('1111123')
        self.assertEqual(len(result), 9)
コード例 #4
0
    def test_case_with_no_ones_or_zeros(self):
        """
        test the case with the number 111-1111

        should yield one combination: '1111111'
        """
        result = telephone_word_combos('1111111')
        self.assertEqual(result, ['1111111'])
コード例 #5
0
    def test_case_with_only_one_mutable(self):
        """
        test the case with the number 111-1112

        should yeild '111111[ABC]'
        """
        result = telephone_word_combos('1111112')
        self.assertEqual(len(result), 3)
        self.assertIn('111111A', result)
        self.assertIn('111111B', result)
        self.assertIn('111111C', result)