Example #1
0
 def test_swver_exception_handling(self, mock_re_findall, mock_execute):
     mock_execute.side_effect = self._mock_manager
     mock_re_findall.side_effect = IndexError
     self.facts['master'] = 'RE0'
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts['version'], '0.0I0.0')
Example #2
0
 def test_swver_hostname_none(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts['master'] = 'RE5'
     self.facts['version_RE5'] = '15.3R6.6'
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts['version'], '15.3R6.6')
Example #3
0
 def test_swver_txp_master_list(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts['master'] = ['RE0', 'RE0', 'RE1', 'RE2', 'RE3']
     self.facts['version_RE0-RE0'] = '14.2R4'
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts['version'], '14.2R4')
Example #4
0
 def test_swver_exception_handling(self, mock_re_findall, mock_execute):
     mock_execute.side_effect = self._mock_manager
     mock_re_findall.side_effect = IndexError
     self.facts['master'] = 'RE0'
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts['version'], '0.0I0.0')
Example #5
0
 def test_swver_f_master_list(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts['master'] = ['RE0', 'RE1']
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts['version'], '12.3R6.6')
Example #6
0
 def test_swver_hostname_none(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts['master'] = 'RE5'
     self.facts['version_RE5'] = '15.3R6.6'
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts['version'], '15.3R6.6')
Example #7
0
 def test_swver_txp_master_list(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts['master'] = ['RE0', 'RE0', 'RE1', 'RE2', 'RE3']
     self.facts['version_RE0-RE0'] = '14.2R4'
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts['version'], '14.2R4')
Example #8
0
 def test_swver_f_master_list(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts['master'] = ['RE0', 'RE1']
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts['version'], '12.3R6.6')
Example #9
0
 def test_swver_exception_handling(self, mock_re_findall, mock_execute):
     mock_execute.side_effect = self._mock_manager
     mock_re_findall.side_effect = IndexError
     self.facts["master"] = "RE0"
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts["version"], "0.0I0.0")
Example #10
0
 def test_swver_txp_master_list(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts["master"] = ["RE0", "RE0", "RE1", "RE2", "RE3"]
     self.facts["version_RE0-RE0"] = "14.2R4"
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts["version"], "14.2R4")
Example #11
0
 def test_swver_hostname_none(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts["master"] = "RE5"
     self.facts["version_RE5"] = "15.3R6.6"
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts["version"], "15.3R6.6")
Example #12
0
 def test_swver_f_master_list(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     self.facts["master"] = ["RE0", "RE1"]
     software_version(self.dev, self.facts)
     self.assertEqual(self.facts["version"], "12.3R6.6")