示例#1
0
    def test_get_meme_pool(self, mock_get):
        """ Test the get_meme_pool function
        """
        # Test with fake meme pool and no internet connection
        A = memesites.MemeSite("http://www.google.com")
        A._meme_pool = set('abc')

        self.assertTrue(A.get_meme_pool() == set('abc'))
示例#2
0
    def test_get_url(self, mock_get):
        """ Test the get url function

        The url returned by the get_url function should be the same
        as the url passed to the constructor at initialization
        """
        A = memesites.MemeSite("http://www.google.com")
        self.assertTrue("http://www.google.com" == A.get_url())
示例#3
0
 def test_clean_meme_deque(self, mock_get):
     """ Test the clean meme deque function with mock requests.get
     """
     # Test with fake meme pool and no internet connection
     A = memesites.MemeSite("http://www.google.com")
     A._meme_deque = deque('abc')
     A.clean_meme_deque()
     self.assertTrue(A._meme_deque == deque())
示例#4
0
    def test_clean_meme_pool(self, mock_get):
        """ Test the clean meme pool function with mock requests.get

        Mocked so that the requests package does not actually make
        http requests
        """
        # Test with fake meme pool and no internet connection
        A = memesites.MemeSite("http://www.google.com")
        A._meme_pool = set('abc')
        A.clean_meme_pool()
        self.assertTrue(A._meme_pool == set())
示例#5
0
 def test_get_meme_num(self, mock_get):
     """ Test the get_meme_num function
     """
     A = memesites.MemeSite("1")
     A._meme_deque = deque('abc')
     self.assertTrue(A.get_meme_num() == 3)