def test_create_softwareVersion_some_missing_arguments(self): with pytest.raises(TypeError): pusher.SoftwareVersion( human_name="test", matching_pattern="16.06.04a", platform_pattern="c9300", )
def softwareversion(self): return pusher.SoftwareVersion( human_name="test", matching_pattern="16.06.04a", platform_pattern="c9300", boot_check="flash:/something.bin", FTP_path="ftp://rwsar", verification_path="test", md5_sum="1234", )
def test_verifySoftware(self, switch_with_fake_data): sw = pusher.SoftwareVersion( human_name="fake software", matching_pattern="fake_old_ver", platform_pattern="fake_hardware", boot_check="fake_boot", FTP_path="ftp://test", verification_path="flash:/test.bin", md5_sum="correct_fake_checksum", ) assert switch_with_fake_data.verifySoftware(sw)
def test_isRunningCorrectSoftware_answer_no(self, switch_with_fake_data): sw = pusher.SoftwareVersion( human_name="fake software", matching_pattern="fake_old_ver", platform_pattern="fake_hardware", boot_check="fake_boot", FTP_path="ftp://test", verification_path="flash:/test.bin", md5_sum="12345", ) assert switch_with_fake_data.isRunningCorrectSoftware(sw) == False
def test_updateSwitch(self, switch_with_fake_data): sw = pusher.SoftwareVersion( human_name="fake software", matching_pattern="fake_pattern", platform_pattern="fake_hardware", boot_check="fake_boot", FTP_path="ftp://test", verification_path="flash:/test.bin", md5_sum="12345", ) switch_with_fake_data.updateSwitch(sw)
def test_needsUpgrade_software_does_need_update(self, switch_with_fake_data): sw = pusher.SoftwareVersion( human_name="fake software", matching_pattern="fake_old_ver", platform_pattern="fake_hardware", boot_check="fake_boot", FTP_path="ftp://test", verification_path="flash:/test.bin", md5_sum="12345", ) assert switch_with_fake_data.needsUpgrade(sw)
def test_create_softwareVersion_missing_arguments(self): with pytest.raises(TypeError): pusher.SoftwareVersion()