示例#1
0
def test_virt_path():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.virt_path = ""

    # Assert
    assert image.virt_path == ""
示例#2
0
def test_virt_type():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.virt_type = enums.VirtType.AUTO

    # Assert
    assert image.virt_type == enums.VirtType.AUTO
示例#3
0
def test_virt_bridge():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.virt_bridge = "testbridge"

    # Assert
    assert image.virt_bridge == "testbridge"
示例#4
0
def test_make_clone():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    result = image.make_clone()

    # Assert
    assert image != result
示例#5
0
def test_virt_ram():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.virt_ram = 5

    # Assert
    assert image.virt_ram == 5
示例#6
0
def test_virt_disk_driver():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.virt_disk_driver = enums.VirtDiskDrivers.RAW

    # Assert
    assert image.virt_disk_driver == enums.VirtDiskDrivers.RAW
示例#7
0
def test_virt_file_size():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.virt_file_size = 500

    # Assert
    assert image.virt_file_size == 500
示例#8
0
def test_virt_auto_boot():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.virt_auto_boot = False

    # Assert
    assert not image.virt_auto_boot
示例#9
0
def test_network_count():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.network_count = 2

    # Assert
    assert image.network_count == 2
示例#10
0
def test_menu():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.menu = ""

    # Assert
    assert image.menu == ""
示例#11
0
def test_image_type():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.image_type = enums.ImageTypes.DIRECT

    # Assert
    assert image.image_type == enums.ImageTypes.DIRECT
示例#12
0
def test_file():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.file = ""

    # Assert
    assert image.file == ""
示例#13
0
def test_autoinstall():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.autoinstall = ""

    # Assert
    assert image.autoinstall == ""
示例#14
0
def test_arch():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.arch = "x86_64"

    # Assert
    assert image.arch == enums.Archs.X86_64
示例#15
0
def test_boot_loaders():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act
    image.boot_loaders = ""

    # Assert
    assert image.boot_loaders == []
示例#16
0
def test_breed():
    # Arrange
    test_api = CobblerAPI()
    utils.load_signatures("/var/lib/cobbler/distro_signatures.json")
    image = Image(test_api)

    # Act
    image.breed = "suse"

    # Assert
    assert image.breed == "suse"
示例#17
0
def test_os_version():
    # Arrange
    test_api = CobblerAPI()
    utils.load_signatures("/var/lib/cobbler/distro_signatures.json")
    image = Image(test_api)
    image.breed = "suse"

    # Act
    image.os_version = "sles15generic"

    # Assert
    assert image.os_version == "sles15generic"
示例#18
0
def test_image_rename():
    # Arrange
    test_api = CobblerAPI()
    testimage = Image(test_api)
    testimage.name = "myimage"
    test_api.add_image(testimage, save=False)

    # Act
    test_api.rename_image(testimage, "new_name")

    # Assert
    assert test_api.images().get("new_name")
    assert test_api.images().get("myimage") is None
示例#19
0
def test_supported_boot_loaders():
    # Arrange
    test_api = CobblerAPI()
    image = Image(test_api)

    # Act & Assert
    assert image.supported_boot_loaders == []
示例#20
0
def test_object_creation():
    # Arrange
    test_api = CobblerAPI()

    # Act
    image = Image(test_api)

    # Arrange
    assert isinstance(image, Image)