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))
def test_no_such_file(self): """ Check the proper exception is thrown for a missing file.""" with self.assertRaises(IOError): analyze_text('foobar')
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.')
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.')
def test_function_runs(self): """ Basic smoke test.""" analyze_text(self.filename)