def test_func_returns_true_after_html_change(self): old_htmls = [object()] new_htmls = [object()] sut = Browser() self.stub_webdriver.html_elements = old_htmls change_detected = sut.func_that_detects_new_page() self.stub_webdriver.html_elements = new_htmls assert change_detected(), "Failed to detect a change"
def test_func_returns_false_when_nothing_has_changed(self): html_elements = [object()] sut = Browser() self.stub_webdriver.html_elements = [html_elements] change_detected = sut.func_that_detects_new_page() assert not change_detected(), "Detected a non-existent change"