  class TestSolution(object):
  
      def test_longest_substr(self):
          solution = Solution()
          assert_raises(TypeError, solution.longest_substr, None)
          assert_equal(solution.longest_substr('', k=3), 0)
          assert_equal(solution.longest_substr('abcabcdefgghiij', k=3), 6)
          assert_equal(solution.longest_substr('abcabcdefgghighij', k=3), 7)
          print('Success: test_longest_substr')
  
  
  def main():
      test = TestSolution()
 
</s> remove class TestSolution(object):
 </s> add class TestSolution(unittest.TestCase): </s> remove     "        assert_raises(TypeError, solution.longest_substr, None)\n",
    "        assert_equal(solution.longest_substr('', k=3), 0)\n",
    "        assert_equal(solution.longest_substr('abcabcdefgghiij', k=3), 6)\n",
    "        assert_equal(solution.longest_substr('abcabcdefgghighij', k=3), 7)\n",
 </s> add     "        self.assertRaises(TypeError, solution.longest_substr, None)\n",
    "        self.assertEqual(solution.longest_substr('', k=3), 0)\n",
    "        self.assertEqual(solution.longest_substr('abcabcdefgghiij', k=3), 6)\n",
    "        self.assertEqual(solution.longest_substr('abcabcdefgghighij', k=3), 7)\n", </s> remove     "        assert_raises(TypeError, solution.longest_substr, None)\n",
    "        assert_equal(solution.longest_substr('', k=3), 0)\n",
    "        assert_equal(solution.longest_substr('abcabcdefgghiij', k=3), 6)\n",
    "        assert_equal(solution.longest_substr('abcabcdefgghighij', k=3), 7)\n",
 </s> add     "        self.assertRaises(TypeError, solution.longest_substr, None)\n",
    "        self.assertEqual(solution.longest_substr('', k=3), 0)\n",
    "        self.assertEqual(solution.longest_substr('abcabcdefgghiij', k=3), 6)\n",
    "        self.assertEqual(solution.longest_substr('abcabcdefgghighij', k=3), 7)\n", </s> remove     "class TestSolution(object):\n",
 </s> add     "class TestSolution(unittest.TestCase):\n", </s> remove     "class TestSolution(object):\n",
 </s> add     "class TestSolution(unittest.TestCase):\n",
        self.assertRaises(TypeError, solution.longest_substr, None)
        self.assertEqual(solution.longest_substr('', k=3), 0)
        self.assertEqual(solution.longest_substr('abcabcdefgghiij', k=3), 6)
        self.assertEqual(solution.longest_substr('abcabcdefgghighij', k=3), 7)
  class TestSolution(object):
  
      def test_longest_substr(self):
          solution = Solution()
        self.assertRaises(TypeError, solution.longest_substr, None)
        self.assertEqual(solution.longest_substr('', k=3), 0)
        self.assertEqual(solution.longest_substr('abcabcdefgghiij', k=3), 6)
        self.assertEqual(solution.longest_substr('abcabcdefgghighij', k=3), 7)
        self.assertRaises(TypeError, solution.longest_substr, None)
        self.assertEqual(solution.longest_substr('', k=3), 0)
        self.assertEqual(solution.longest_substr('abcabcdefgghiij', k=3), 6)
        self.assertEqual(solution.longest_substr('abcabcdefgghighij', k=3), 7)
        self.assertRaises(TypeError, solution.longest_substr, None)
        self.assertEqual(solution.longest_substr('', k=3), 0)
        self.assertEqual(solution.longest_substr('abcabcdefgghiij', k=3), 6)
        self.assertEqual(solution.longest_substr('abcabcdefgghighij', k=3), 7)
        self.assertRaises(TypeError, solution.longest_substr, None)
        self.assertEqual(solution.longest_substr('', k=3), 0)
        self.assertEqual(solution.longest_substr('abcabcdefgghiij', k=3), 6)
        self.assertEqual(solution.longest_substr('abcabcdefgghighij', k=3), 7)
          print('Success: test_longest_substr')
  
  
  def main():
      test = TestSolution()
keep keep keep keep replace replace replace replace keep keep keep keep keep
 #273: Remove nose dependency for recursion_dynamic/ (#280) 
recursion_dynamic/longest_substr_k_distinct/test_longest_substr.py