Python3 Local Setup

Python3 Local Setup

Setup for tests and debugging for Leetcode’s Solution class.

from typing import List
import unittest
import pdb

class Solution:
    def myFunction(self, input_list: List[int]) -> bool:
        # pdb.set_trace()
        if len(input_list) > 0:
            return True
        else:
            return False

class TestExample(unittest.TestCase):
    def setUp(self):
        self.solution = Solution()

    def test_searchRange(self):
        self.assertEqual(self.solution.myFunction([2, 2]), True)
        self.assertTrue(self.solution.myFunction([1, 2, 3]))
        self.assertFalse(self.solution.myFunction([]))

if __name__ == '__main__':
    unittest.main()