def test_template_files(param, result): # Arrange version = Osversion() # Act version.template_files = param # Assert assert version.template_files == result
def test_version_file_regex(param, result): # Arrange version = Osversion() # Act version.version_file_regex = param # Assert assert version.version_file_regex == result
def test_default_autoinstall(param, result): # Arrange version = Osversion() # Act version.default_autoinstall = param # Assert assert version.default_autoinstall == result
def test_kernel_arch(param, result): # Arrange version = Osversion() # Act version.kernel_arch = param # Assert assert version.kernel_arch == result
def test_initrd_file(param, result): # Arrange version = Osversion() # Act version.initrd_file = param # Assert assert version.initrd_file == result
def test_supported_arches(param, result): # Arrange osversion = Osversion() # Act osversion.supported_arches = param # Assert assert osversion.supported_arches == result
def test_kernel_options_post(param, result): # Arrange version = Osversion() # Act version.kernel_options_post = param # Assert assert version.kernel_options_post == result
def test_supported_repo_breeds(param, result): # Arrange osversion = Osversion() # Act osversion.supported_repo_breeds = param # Assert assert result
def test_isolinux_ok(param, result, raises): # Arrange version = Osversion() # Act with raises: version.isolinux_ok = param # Assert assert version.isolinux_ok == result
def test_kernel_file(param, result, raises): # Arrange version = Osversion() # Act with raises: version.kernel_file = param # Assert assert version.kernel_file == result
def test_addosversion(): # Arrange os_signatures = Signatures() os_signatures.addosbreed("suse") # Act os_signatures.addosversion(0, "sles", Osversion()) # Assert assert os_signatures.osbreeds[0].osversions["sles"] == Osversion()
def test_boot_loaders(param, result, raises): # Arrange version = Osversion() # Act with raises: version.boot_loaders = param # Assert assert version.boot_loaders == result
def test_signatures(param, result, raises): # Arrange version = Osversion() # Act with raises: version.signatures = param # Assert assert version.signatures == result
def test_decode(): # Arrange version = Osversion() data = {"version_file": "test"} # Act version.decode(data) # Assert assert version.version_file == "test"
def decode(self, data: dict): """ Decodes the received data. Decoding of each single version is done by the corresponding decode method in :class:`Osversion`. :param data: The data to decode. """ for key in data.keys(): version = Osversion() version.decode(data.get(key)) self.osversion_add(key, version)
def test_encode(): # Arrange version = Osversion() # Act result = version.encode() # Assert assert isinstance(result, dict) # If we have an empty version, only the bools are shown. assert len(result) == 1
def test_encode(): # Arrange breed = OsBreed("test") breed.osversion_add("test1", Osversion()) breed.osversion_add("test2", Osversion()) # Act result = breed.encode() # Assert assert isinstance(result, dict) assert "test1" in result assert "test2" in result assert isinstance(result["test1"], dict)
def test_breed_remove(): # Arrange itemname = "test" osbreed = OsBreed(itemname) osbreed.osversion_add(itemname, Osversion()) # Act osbreed.osversion_remove(itemname)
def test_kernel_arch_del(): # Arrange version = Osversion() # Act del version.kernel_arch # Assert assert version.kernel_arch == ""
def test_initrd_file_del(): # Arrange version = Osversion() # Act del version.initrd_file # Assert assert version.initrd_file == ""
def test_version_file_regex_del(): # Arrange version = Osversion() # Act del version.version_file_regex # Assert assert version.version_file_regex == ""
def test_isolinux_ok_del(): # Arrange version = Osversion() # Act del version.isolinux_ok # Assert assert not version.isolinux_ok
def test_kernel_options_post_del(): # Arrange version = Osversion() # Act del version.kernel_options_post # Assert assert version.kernel_options_post == ""
def test_boot_loaders_del(): # Arrange version = Osversion() # Act del version.boot_loaders # Assert assert version.boot_loaders == {}
def test_default_autoinstall_del(): # Arrange version = Osversion() # Act del version.default_autoinstall # Assert assert version.default_autoinstall == ""
def test_kernel_file_del(): # Arrange version = Osversion() # Act del version.kernel_file # Assert assert version.kernel_file == ""
def test_template_files_del(): # Arrange version = Osversion() # Act del version.template_files # Assert assert version.template_files == ""
def test_signatures_del(): # Arrange version = Osversion() # Act del version.signatures # Assert assert version.signatures == set()
def test_boot_files_del(): # Arrange version = Osversion() # Act del version.boot_files # Assert assert version.boot_files == set()
def test_supported_repo_breeds_del(): # Arrange version = Osversion() # Act del version.supported_repo_breeds # Assert assert version.supported_repo_breeds == []