示例#1
0
def test_remote_grub_kernel(value, expected_exception):
    # Arrange
    test_api = CobblerAPI()
    distro = Distro(test_api)

    # Act
    with expected_exception:
        distro.remote_boot_kernel = value

        # Assert
        assert distro.remote_grub_kernel == value
示例#2
0
def test_remote_boot_kernel(value, expected_exception):
    # Arrange
    # TODO: Create fake kernel so we can test positive paths
    test_api = CobblerAPI()
    distro = Distro(test_api)

    # Act
    with expected_exception:
        distro.remote_boot_kernel = value

        # Assert
        assert distro.remote_boot_kernel == value
示例#3
0
def test_serialize():
    # Arrange
    kernel_url = "http://10.0.0.1/custom-kernels-are-awesome"
    test_api = CobblerAPI()
    titem = Distro(test_api)
    titem.remote_boot_kernel = kernel_url

    # Act
    result = titem.serialize()

    # Assert
    assert titem.remote_boot_kernel == kernel_url
    assert titem.remote_grub_kernel.startswith("(http,")
    assert "remote_grub_kernel" not in result