def test_vgood(self): self.text = ShortText.check_text("Stop bloody lightning") correct_text = "Stop bloody lightning" self.assertEqual( correct_text, self.text)
def test_good4(self): self.text = ShortText.check_text("43") correct_text = "43" self.assertEqual( correct_text, self.text)
def test_good5(self): self.text = ShortText.check_text("Something, something else Something, something elseSomething, something elseSomething, something elseSomething, something elseSomething, something elseSomething, something elseSomething, something elseSomething, something elseSomething, something else") correct_text = "Something, something else Something, something elseSomething, something elseSomething, something els" self.assertEqual( correct_text, self.text)
def test_middle3(self): self.text = ShortText.check_text("\"thunder\"=") correct_text = "'thunder'=" self.assertEqual( correct_text, self.text)
def test_bad2(self): self.text = ShortText.check_text("; DROP tables ;") correct_text = "Drop tables" self.assertEqual( correct_text, self.text)
def test_bad1(self): self.text = ShortText.check_text("|4579^%%)%^&*_;") correct_text = "4579^%%)%&*_" self.assertEqual( correct_text, self.text)
def test_vbad0(self): self.text = ShortText.check_text("") correct_text = "" self.assertEqual( correct_text, self.text)
def setUp(self): self.text = ShortText.check_text("")