示例#1
0
 def test_RhythmOfWar(self):
     search_term = "Rhythm of War"
     driver = amazon_driver()
     expected = "https://m.media-amazon.com/images/I/61kddyNOd5L.jpg"
     actual = extract_image(
         choose_result(amazon_search(driver, search_term), search_term))
     driver.quit()
     assert actual == expected, f"Expected: {expected}, Actual: {actual}"
示例#2
0
 def test_RhythmOfWar(self):
     search_term = "Rhythm of War"
     expected = "Brandon Sanderson"
     driver = amazon_driver()
     actual = extract_author(
         choose_result(amazon_search(driver, search_term), search_term))
     driver.quit()
     assert actual == expected, f"Expected: {expected}, Actual: {actual}"
示例#3
0
 def test_DataLoom(self):
     search_term = "The Data Loom"
     driver = amazon_driver()
     expected = "https://images-na.ssl-images-amazon.com/images/I/41gHdOK6zPL._SX331_BO1,204,203,200_.jpg"
     actual = extract_image(
         choose_result(amazon_search(driver, search_term), search_term))
     driver.quit()
     assert actual == expected, f"Expected: {expected}, Actual: {actual}"
示例#4
0
 def test_DataLoom(self):
     search_term = "The Data Loom"
     expected = "Stephen Few"
     driver = amazon_driver()
     actual = extract_author(
         choose_result(amazon_search(driver, search_term), search_term))
     driver.quit()
     assert actual == expected, f"Expected: {expected}, Actual: {actual}"
示例#5
0
 def test_the_data_loom(self):
     search_term = "The Data Loom"
     driver = amazon_driver()
     url = choose_result(amazon_search(driver, search_term), search_term).current_url
     expected_url = "https://www.amazon.com/dp/1938377117" 
     actual_url = truncate_url(url)
     driver.quit()
     assert actual_url == expected_url, f"Expected: {expected_url}, Actual {actual_url}"
示例#6
0
 def test_ThinkingFastAndSlow(self):
     search_term = "Thinking, Fast and Slow"
     expected_title = search_term
     driver = amazon_driver()
     expected_subtitle = ''
     actual_title, actual_subtitle = extract_title(
         choose_result(amazon_search(driver, search_term), search_term))
     driver.quit()
     assert actual_title == expected_title, f"Expected: {expected_title}, Actual: {actual_title}"
     assert actual_subtitle == expected_subtitle, f"Expected: {expected_subtitle}, Actual: {actual_subtitle}"
示例#7
0
 def test_RhythmOfWar(self):
     search_term = "Rhythm of War"
     expected_title = search_term
     driver = amazon_driver()
     expected_subtitle = 'The Stormlight Archive, Book 4'
     actual_title, actual_subtitle = extract_title(
         choose_result(amazon_search(driver, search_term), search_term))
     driver.quit()
     assert actual_title == expected_title, f"Expected: {expected_title}, Actual: {actual_title}"
     assert actual_subtitle == expected_subtitle, f"Expected: {expected_subtitle}, Actual: {actual_subtitle}"
示例#8
0
 def test_DataLoom(self):
     search_term = "The Data Loom"
     driver = amazon_driver()
     expected_title = "The Data Loom"
     expected_subtitle = "Weaving Understanding by Thinking Critically and Scientifically with Data"
     actual_title, actual_subtitle = extract_title(
         choose_result(amazon_search(driver, search_term), search_term))
     driver.quit()
     assert actual_title == expected_title, f"Expected: {expected_title}, Actual: {actual_title}"
     assert actual_subtitle == expected_subtitle, f"Expected: {expected_subtitle}, Actual: {actual_subtitle}"