Exemplo n.º 1
0
  def test_get_os_version(self, mock_linux_distribution):

    # 1 - Any system
    mock_linux_distribution.return_value = ('', '123.45', '')
    result = OSCheck.get_os_version()
    self.assertEquals(result, '123.45')

    # 2 - Negative case
    mock_linux_distribution.return_value = ('ssss', '', 'ddddd')
    try:
      result = OSCheck.get_os_version()
      self.fail("Should throw exception in OSCheck.get_os_version()")
    except Exception as e:
      # Expected
      self.assertEquals("Cannot detect os version. Exiting...", str(e))
      pass
Exemplo n.º 2
0
 def os_version(self):
     """
 Example return value:
 "6.3" for "Centos 6.3"
 
 In case cannot detect --> Fail
 """
     return OSCheck.get_os_version()
Exemplo n.º 3
0
 def getOperatingSystemRelease(self):
     return OSCheck.get_os_version()