def test_check_optional_none(self):
     '''Test check_optional() - protocol only'''
     self.set_test_url_dispatcher(self.default_appname,
                                  key="protocol",
                                  value="some-protocol")
     c = ClickReviewUrlDispatcher(self.test_name)
     c.check_optional()
     r = c.click_report
     expected_counts = {'info': 1, 'warn': 0, 'error': 0}
     self.check_results(r, expected_counts)
 def test_check_optional_domain_suffix_without_protocol(self):
     '''Test check_optional() - with domain-suffix, no protocol'''
     self.set_test_url_dispatcher(self.default_appname,
                                  key="domain-suffix",
                                  value="example.com")
     c = ClickReviewUrlDispatcher(self.test_name)
     c.check_optional()
     r = c.click_report
     expected_counts = {'info': 1, 'warn': 0, 'error': 0}
     self.check_results(r, expected_counts)
 def test_check_optional_domain_suffix_bad(self):
     '''Test check_optional() - with bad domain-suffix'''
     self.set_test_url_dispatcher(self.default_appname,
                                  key="protocol",
                                  value="some-protocol")
     self.set_test_url_dispatcher(self.default_appname,
                                  key="domain-suffix",
                                  value=[],
                                  append=True)
     c = ClickReviewUrlDispatcher(self.test_name)
     c.check_optional()
     r = c.click_report
     expected_counts = {'info': 0, 'warn': 0, 'error': 1}
     self.check_results(r, expected_counts)
 def test_check_optional_domain_suffix_nonexistent(self):
     '''Test check_optional() - with domain-suffix plus nonexistent'''
     self.set_test_url_dispatcher(self.default_appname,
                                  key="protocol",
                                  value="some-protocol")
     self.set_test_url_dispatcher(self.default_appname,
                                  key="domain-suffix",
                                  value="example.com",
                                  append=True)
     self.set_test_url_dispatcher(self.default_appname,
                                  key="nonexistent",
                                  value="foo",
                                  append=True)
     c = ClickReviewUrlDispatcher(self.test_name)
     c.check_optional()
     r = c.click_report
     expected_counts = {'info': 1, 'warn': 0, 'error': 0}
     self.check_results(r, expected_counts)