def setUp(self):
     self.spider = Spider(log=Logging(log_file_name="test.log"),
                          database=MongoDB(
                              collection_name='test_collection_urls',
                              database_name='test_database',
                          ))
     self.url = "http://www.google.com"
 def setUp(self):
     self.spider = Spider(
         log=Logging(log_file_name="test.log"),
         database=MongoDB(
             collection_name='test_collection_urls',
             database_name='test_database',
         )
     )
     self.url = "http://www.google.com"
class SpiderTestCase(unittest.TestCase):
    def setUp(self):
        self.spider = Spider(log=Logging(log_file_name="test.log"),
                             database=MongoDB(
                                 collection_name='test_collection_urls',
                                 database_name='test_database',
                             ))
        self.url = "http://www.google.com"

    def test_get_links(self):

        # test that the url is tested as existing correctly
        self.assertTrue(self.spider.get_links(self.url) > 0)

    def tearDown(self):
        self.spider.database.remove()
        clear_log(self.spider.log.log_file_name)
class SpiderTestCase(unittest.TestCase):
    def setUp(self):
        self.spider = Spider(
            log=Logging(log_file_name="test.log"),
            database=MongoDB(
                collection_name='test_collection_urls',
                database_name='test_database',
            )
        )
        self.url = "http://www.google.com"
        
    def test_get_links(self):
        
        # test that the url is tested as existing correctly
        self.assertTrue(self.spider.get_links(self.url) > 0)
    
    def tearDown(self):
        self.spider.database.remove()
        clear_log(self.spider.log.log_file_name)