openSUSE-release-tools/tests/check_tests.py
Jimmy Berry 6069245350 Remove SUSE copyright, warranty, and license headers.
Distinct copyrights were left as I do not wish to track down commit
history to ensure it properly documents the copyright holders. Also left
non-GPLv2 licenses and left bs_copy untouched as a mirror from OBS.

Already have a mix of with and without headers and even OBS does not place
on majority of files. If SUSE lawyers have an issue it will come up in
legal review for Factory.
2018-08-23 19:18:06 -05:00

63 lines
2.1 KiB
Python

import unittest
from obs import APIURL
from obs import OBS
from osclib.conf import Config
from osclib.check_command import CheckCommand
from osclib.stagingapi import StagingAPI
FULL_REPORT = """
++ Acceptable staging project openSUSE:Factory:Staging:A
++ Acceptable staging project openSUSE:Factory:Staging:C
-- REVIEW Project openSUSE:Factory:Staging:F still needs attention
- yast2-iscsi-client: Missing reviews: factory-repo-checker
-- REVIEW Project openSUSE:Factory:Staging:G still needs attention
- Mesa: Missing reviews: opensuse-review-team
-- BUILDING Project openSUSE:Factory:Staging:H still needs attention
- kiwi: Missing reviews: opensuse-review-team
- At least following repositories are still building:
standard/i586: building
- openQA's overall status is failed for https://openqa.opensuse.org/tests/10660
first_boot: fail
-- REVIEW Project openSUSE:Factory:Staging:J still needs attention
- jeuclid: Missing reviews: factory-repo-checker
"""
H_REPORT = """
-- BUILDING Project openSUSE:Factory:Staging:H still needs attention
- kiwi: Missing reviews: opensuse-review-team
- At least following repositories are still building:
standard/i586: scheduling
standard/x86_64: building
images/x86_64: blocked
- openQA's overall status is failed for https://openqa.opensuse.org/tests/10660
livecdreboot: fail
"""
class TestCheckCommand(unittest.TestCase):
"""Tests CheckCommand."""
def setUp(self):
"""Initialize the configuration."""
self.obs = OBS()
Config(APIURL, 'openSUSE:Factory')
self.stagingapi = StagingAPI(APIURL, 'openSUSE:Factory')
self.checkcommand = CheckCommand(self.stagingapi)
def test_check_command_all(self):
"""Validate json conversion for all projects."""
report = self.checkcommand._check_project()
self.assertEqual('\n'.join(report).strip(), FULL_REPORT.strip())
def test_check_command_single(self):
"""Validate json conversion for a single project."""
report = self.checkcommand._check_project('H')
self.assertEqual('\n'.join(report).strip(), H_REPORT.strip())