Exemplo n.º 1
0
 def test_get_hostname_from_url(self):
     self.assertEqual(
         media_wiki_tools.get_hostname_from_url(
             'http://muppet.wikia.com/page?noexternals=1'), 'wikia.com',
         'Invalid hostname')
     self.assertEqual(
         media_wiki_tools.get_hostname_from_url(
             'http://muppet.synth1.wikia-dev.com/page?noexternals=1'),
         'synth1.wikia-dev.com', 'Invalid hostname')
     try:
         media_wiki_tools.get_hostname_from_url('invalidurl')
         self.fail('Expected exception was not thrown')
     except Exception:
         pass
Exemplo n.º 2
0
 def get_test_list(url):
     hostname = media_wiki_tools.get_hostname_from_url(url)
     url_muppet = 'http://muppet.{0}/wiki/Kermit'.format(hostname)
     url_perftest = 'http://perftest.{0}/wiki/Medium_Article'.format(hostname)
     url_perftest_no_externals = 'http://perftest.{0}/wiki/Medium_Article?noexternals=1'.format(
         hostname)
     return [
         {'test_func': 'enter_page', 'test_name': 'load_provided_url',
          'params': {'url': url}},
         # {'test_func': 'enter_page', 'test_name': 'oasis_muppet_kermit',
         #  'params': {'url': url_muppet}},
         # {'test_func': 'enter_page', 'test_name': 'oasis_perftest_medium_article_no_ads',
         #  'params': {'url': url_perftest}},
         # {'test_func': 'enter_page', 'test_name': 'oasis_perftest_medium_article_no_externals',
         #  'params': {'url': url_perftest_no_externals}},
         # {'test_func': 'perftest_oasis_anon_search_pageviews', 'test_name': 'perftest_oasis_anon_search_pageviews',
         #  'params': {'hostname': hostname}},
         # {'test_func': 'perftest_oasis_user_search_pageviews', 'test_name': 'perftest_oasis_user_search_pageviews',
         #  'params': {'hostname': hostname}}
     ]