Example #1
0
 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
Example #2
0
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")
Example #3
0
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")
Example #4
0
 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")
Example #5
0
 def test_that_we_raise_when_error_not_thrown(self):
     try:
         Assert.raises(Exception, self._add_num, 5,4)
     except AssertionError:
         pass
Example #6
0
 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. ")
Example #8
0
 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"))
Example #9
0
 def test_that_we_raise_when_error_not_thrown(self):
     try:
         Assert.raises(Exception, self._add_num, 5, 4)
     except AssertionError:
         pass
Example #10
0
 def test_that_assert_raises_catches_exceptions(self):
     Assert.raises(ZeroDivisionError, self._divide_by_zero)
Example #11
0
 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())
Example #12
0
 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"))
Example #13
0
 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"))
Example #14
0
 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
Example #15
0
 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())
Example #16
0
 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"))