示例#1
0
 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",
         )
示例#2
0
 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",
     )
示例#3
0
 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)
示例#4
0
 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
示例#5
0
 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)
示例#6
0
 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)
示例#7
0
 def test_create_softwareVersion_missing_arguments(self):
     with pytest.raises(TypeError):
         pusher.SoftwareVersion()