Ejemplo n.º 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))
Ejemplo n.º 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')
Ejemplo n.º 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.')
Ejemplo n.º 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.')
Ejemplo n.º 5
0
 def test_function_runs(self):
     """ Basic smoke test."""
     analyze_text(self.filename)