示例#1
0
 def test_make_soup_error(self, mock_requests):
     url = 'http://www.socialsecurity.gov/xxxx/'
     mock_requests.return_value.reason = 'Not found'
     soup = make_soup(url)
     self.assertEqual(soup, '')
示例#2
0
 def test_make_soup(self):
     """ given a url, makes a request and returns beautifulsoup for parsing
     """
     url = 'http://www.socialsecurity.gov/OACT/ProgData/nra.html'
     soup = make_soup(url)
     self.assertEqual(soup.find('h1').text, 'Social Security')
 def test_make_soup(self):
     """ given a url, makes a request and returns beautifulsoup for parsing
     """
     url = 'http://www.socialsecurity.gov/OACT/ProgData/nra.html'
     soup = make_soup(url)
     self.assertTrue('Social Security' in soup.find('h1').text)
 def test_make_soup_error(self, mock_requests):
     url = 'http://www.socialsecurity.gov/xxxx/'
     mock_requests.return_value.reason = 'Not found'
     soup = make_soup(url)
     self.assertEqual(soup, '')
示例#5
0
 def test_make_soup(self):
     """ given a url, makes a request and returns beautifulsoup for parsing
     """
     url = "http://www.socialsecurity.gov/OACT/ProgData/nra.html"
     soup = make_soup(url)
     self.assertEqual(soup.find("h1").text, "Social Security")