示例#1
0
 def test_no_deletion(self):
     """ Check that the function doesn't delete the input file."""
     analyze_text(self.filename)
     self.assertTrue(os.path.exists(self.filename))
示例#2
0
 def test_no_such_file(self):
     """ Check the proper exception is thrown for a missing file."""
     with self.assertRaises(IOError):
         analyze_text('foobar')
示例#3
0
 def test_line_count(self):
     """ Check that the line count is correct."""
     self.assertEqual(
         analyze_text(self.filename)[0], 4,
         'Test Failed: Line count does not match.')
示例#4
0
 def test_character_count(self):
     """ Check that the character count is correct."""
     self.assertEqual(
         analyze_text(self.filename)[1], 131,
         'Test Failed: Character count does not match.')
示例#5
0
 def test_function_runs(self):
     """ Basic smoke test."""
     analyze_text(self.filename)