예제 #1
0
def test_apt_dists():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.apt_dists = []

    # Assert
    assert testrepo.apt_dists == []
예제 #2
0
def test_arch():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.arch = "x86_64"

    # Assert
    assert testrepo.arch == enums.RepoArchs.X86_64
예제 #3
0
def test_rsyncopts():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.rsyncopts = {}

    # Assert
    assert testrepo.rsyncopts == {}
예제 #4
0
def test_environment():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.environment = {}

    # Assert
    assert testrepo.environment == {}
예제 #5
0
def test_mirror_type():
    # Arrange
    test_api = CobblerAPI()
    repo = Repo(test_api)

    # Act
    repo.mirror_type = enums.MirrorType.BASEURL

    # Assert
    assert repo.mirror_type == enums.MirrorType.BASEURL
예제 #6
0
def test_keep_updated():
    # Arrange
    test_api = CobblerAPI()
    repo = Repo(test_api)

    # Act
    repo.keep_updated = False

    # Assert
    assert not repo.keep_updated
예제 #7
0
def test_proxy():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.proxy = ""

    # Assert
    assert testrepo.proxy == ""
예제 #8
0
def test_mirror():
    # Arrange
    test_api = CobblerAPI()
    repo = Repo(test_api)

    # Act
    repo.mirror = "https://mymirror.com"

    # Assert
    assert repo.mirror == "https://mymirror.com"
예제 #9
0
def test_priority():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.priority = 5

    # Assert
    assert testrepo.priority == 5
예제 #10
0
def test_rpm_list():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.rpm_list = []

    # Assert
    assert testrepo.rpm_list == []
예제 #11
0
def test_breed():
    # Arrange
    test_api = CobblerAPI()
    repo = Repo(test_api)

    # Act
    repo.breed = "yum"

    # Assert
    assert repo.breed == enums.RepoBreeds.YUM
예제 #12
0
def test_mirror_locally():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.mirror_locally = False

    # Assert
    assert not testrepo.mirror_locally
예제 #13
0
def test_createrepo_flags():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    testrepo.createrepo_flags = ""

    # Assert
    assert testrepo.createrepo_flags == ""
예제 #14
0
def test_make_clone():
    # Arrange
    test_api = CobblerAPI()
    repo = Repo(test_api)

    # Act
    result = repo.make_clone()

    # Assert
    assert result != repo
예제 #15
0
def test_os_version():
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)
    testrepo.breed = "yum"

    # Act
    testrepo.os_version = "rhel4"

    # Assert
    assert testrepo.breed == enums.RepoBreeds.YUM
    assert testrepo.os_version == "rhel4"
예제 #16
0
def test_set_repo_os_version():
    # Arrange
    test_api = CobblerAPI()
    test_manager = CollectionManager(test_api)
    testrepo = Repo(test_manager)
    testrepo.set_breed("yum")

    # Act
    utils.set_repo_os_version(testrepo, "rhel4")

    # Assert
    assert testrepo.breed == "yum"
    assert testrepo.os_version == "rhel4"
예제 #17
0
def test_arch(value, expected_exception):
    # Arrange
    test_api = CobblerAPI()
    testrepo = Repo(test_api)

    # Act
    with expected_exception:
        testrepo.arch = value

        # Assert
        if isinstance(value, str):
            assert testrepo.arch.value == value
        else:
            assert testrepo.arch == value
예제 #18
0
def test_object_creation():
    # Arrange
    test_api = CobblerAPI()

    # Act
    repo = Repo(test_api)

    # Arrange
    assert isinstance(repo, Repo)
예제 #19
0
def test_set_repo_breed():
    # Arrange
    test_api = CobblerAPI()
    test_manager = CollectionManager(test_api)
    testrepo = Repo(test_manager)

    # Act
    utils.set_repo_breed(testrepo, "yum")

    # Assert
    assert testrepo.breed == "yum"