def test_non_number_build_nr_also_finds_valid_review_build_urls(): args = cache_test_args_factory() args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'live') args.job_group_urls = args.host + '/group_overview/27' browser = openqa_review.Browser(args, urljoin(args.host, args.base_url)) current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last') assert '=0104%400351' in current # i.e. escaped '0104@0351' assert '=0104%400350' in reviewed # not available anymore, reverting to last two finished
def test_get_job_groups_yields_job_groups_in_page(): args = cache_test_args_factory() args.job_groups = None args.job_group_urls = None args.load_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'single_job_group') root_url = urljoin(args.host, args.base_url) browser = openqa_review.Browser(args, root_url) job_groups = openqa_review.get_job_groups(browser, root_url, args) assert len(job_groups.keys()) == 8
def test_get_build_urls_to_compare_finds_last_reviewed_if_selected(): args = cache_test_args_factory() browser = openqa_review.Browser(args, urljoin(args.host, args.base_url)) current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='0311') assert '=0311' in current assert '=0307' in reviewed # If '--against-reviewed' is 'last', search for the latest finished current, reviewed = openqa_review.get_build_urls_to_compare( browser, args.job_group_urls, against_reviewed='last') assert '=0313' in current assert '=0307' in reviewed
def browser_factory(args=None): if not args: args = cache_test_args_factory() return openqa_review.Browser(args, urljoin(args.host, args.base_url))