</div> </div> <div class="after entityCont">Nothing here just testing...</div> </body> """ def tearDown(self): del self.html_data class Test_FeedDownloader(BaseTest): def setUp(self): super(Test_FeedDownloader, self).setUp() def test_parsing(self): '''Pass the html doc and check if it parses and extracts correctly the data.''' pass if __name__ == '__main__': tools.run_tests( [Test_FeedDownloader], 'reports', 'unittests - feed_downloader.py test report', 'General test results' )
<div class="clear"> </div> </div> </div> <div class="after entityCont">Nothing here just testing...</div> </body> """ def tearDown(self): tools.exclude_path("../src/") del self.html_doc class NaftemporikiParser_Test(BaseParser_Test): def test_parse(self): from parser import NaftemporikiParser np = NaftemporikiParser(self.html_doc) parsed_data = np.parse() print parsed_data if __name__ == '__main__': tools.run_tests( [NaftemporikiParser_Test], 'reports', 'unittests - feed_downloader.py test report', 'General test results' )
# Include on the python path the src directory, so you can perform # invoke modules. tools.include_path("src/") def exclude_src(): tools.exclude_path("src/") class SQLiteConnector_Test(unittest.TestCase): def setUp(self): include_src() import db_storage self.db_storage = db_storage.SQLiteConnector('tmp.db') def tearDown(self): exclude_src() def test_store(self): self.db_storage.store('id', ['title', 'hash', 'filename', 'timestamp']) if __name__ == '__main__': tools.run_tests( [SQLiteConnector_Test], 'test/reports/', 'Unittest - db_storage.py test report', "General test results" )