Пример #1
0
    def test_isHappy(self):
        """
        given: 19
        return: True
        """
        num = 19
        expected = True

        sol = Solution()
        result = sol.isHappy(num)
        self.assertIs(result, expected)
Пример #2
0
 def test_happy_number(self):
     solution = Solution()
     self.assertEqual(solution.isHappy(1), True)
     self.assertEqual(solution.isHappy(11), False)
     self.assertEqual(solution.isHappy(12), False)
     self.assertEqual(solution.isHappy(19), True)
     self.assertEqual(solution.isHappy(100), True)
Пример #3
0
def test_2_false(sol: Solution, ):
    assert sol.is_happy(2) == False
Пример #4
0
def sol() -> Solution:
    return Solution()
Пример #5
0
def test_2121_true(sol: Solution, ):
    assert sol.is_happy(2121) == True
Пример #6
0
def test_111111_false(sol: Solution, ):
    assert sol.is_happy(111111) == False
Пример #7
0
def test_19_true(sol: Solution, ):
    assert sol.is_happy(19) == True
Пример #8
0
def test_476_false(sol: Solution, ):
    assert sol.is_happy(476) == False