def test_addon_type_fails_when_addon_is_not_in_results(self, testsetup): addons_xml = AddOnsAPI(testsetup) try: Assert.raises(AttributeError, addons_xml.get_addon_type_id("Firepug")) except AssertionError: pass
def test_lambda_long_wait(): incman = Incrementor() Assert.raises(TimedOutError, wait_for, lambda self: self.i_sleep_a_lot() > 10, [incman], num_sec=10, message="waiting for sleepy head")
def test_raises_failure_with_message(self): try: Assert.raises(Exception, self._add_num, 5, 4, msg="failure message") except AssertionError as e: Assert.equal(e.msg, "Exception was not raised. failure message")
def test_that_we_raise_when_error_not_thrown(self): try: Assert.raises(Exception, self._add_num, 5,4) except AssertionError: pass
def test_that_assert_raises_catches_exceptions(self): Assert.raises(ZeroDivisionError, self._divide_by_zero)
def test_raises_failure_without_message(self): try: Assert.raises(Exception, self._add_num, 5, 4,) except AssertionError as e: Assert.equal(e.msg, "Exception was not raised. ")
def test_addon_version_number_fails_when_addon_is_not_in_results( self, testsetup): addons_xml = AddOnsAPI(testsetup) Assert.raises(AttributeError, addons_xml.get_addon_version_number("Firepug"))
def test_that_we_raise_when_error_not_thrown(self): try: Assert.raises(Exception, self._add_num, 5, 4) except AssertionError: pass
def test_first_addon_fails_when_addon_is_not_in_results(self, testsetup): addons_xml = AddOnsAPI(testsetup) bad_xml = AddOnsAPI("Firepug") #try: Assert.raises(AttributeError, addons_xml) #self.bad_xml.get_name_of_first_addon())
def test_addon_is_not_in_search_results(self, testsetup): addons_xml = AddOnsAPI(testsetup) Assert.raises(AttributeError, addons_xml.get_xml_for_single_addon("Firepug"))
def test_addon_version_number_fails_when_addon_is_not_in_results(self, testsetup): addons_xml = AddOnsAPI(testsetup) Assert.raises(AttributeError, addons_xml.get_addon_version_number("Firepug"))
def test_first_addon_fails_when_addon_is_not_in_results(self, testsetup): addons_xml = AddOnsAPI(testsetup) bad_xml = AddOnsAPI("Firepug") # try: Assert.raises(AttributeError, addons_xml) # self.bad_xml.get_name_of_first_addon())