from __future__ import absolute_import

# Import Salt Testing Libs
from tests.support.case import SSHCase
from tests.support.unit import skipIf

# Import Salt Libs
import salt.utils


@skipIf(salt.utils.is_windows(), 'salt-ssh not available on Windows')
class SSHGrainsTest(SSHCase):
    '''
    testing grains with salt-ssh
    '''
    def test_grains_items(self):
        '''
        test grains.items with salt-ssh
        '''
        ret = self.run_function('grains.items')
        self.assertEqual(ret['kernel'], 'Linux')
        self.assertTrue(isinstance(ret, dict))

from __future__ import absolute_import

# Import Salt Testing Libs
from tests.support.case import SSHCase
from tests.support.unit import skipIf

# Import Salt Libs
import salt.utils


@skipIf(salt.utils.is_windows(), 'salt-ssh not available on Windows')
class SSHGrainsTest(SSHCase):
    '''
    testing grains with salt-ssh
    '''
    def test_grains_items(self):
        '''
        test grains.items with salt-ssh
        '''
        ret = self.run_function('grains.items')
        grain = 'Linux'
        if salt.utils.platform.is_darwin():
            grain = 'Darwin'
        self.assertEqual(ret['kernel'], grain)
        self.assertTrue(isinstance(ret, dict))

Add darwin value for ssh grain items tests on MacOSX
Add darwin value for ssh grain items tests on MacOSX

  from __future__ import absolute_import
  
  # Import Salt Testing Libs
  from tests.support.case import SSHCase
  from tests.support.unit import skipIf
  
  # Import Salt Libs
  import salt.utils
  
  
  @skipIf(salt.utils.is_windows(), 'salt-ssh not available on Windows')
  class SSHGrainsTest(SSHCase):
      '''
      testing grains with salt-ssh
      '''
      def test_grains_items(self):
          '''
          test grains.items with salt-ssh
          '''
          ret = self.run_function('grains.items')
+         grain = 'Linux'
+         if salt.utils.platform.is_darwin():
+             grain = 'Darwin'
-         self.assertEqual(ret['kernel'], 'Linux')
+         self.assertEqual(ret['kernel'], grain)
          self.assertTrue(isinstance(ret, dict))
  
Add darwin value for ssh grain items tests on MacOSX
## Code Before:
from __future__ import absolute_import

# Import Salt Testing Libs
from tests.support.case import SSHCase
from tests.support.unit import skipIf

# Import Salt Libs
import salt.utils


@skipIf(salt.utils.is_windows(), 'salt-ssh not available on Windows')
class SSHGrainsTest(SSHCase):
    '''
    testing grains with salt-ssh
    '''
    def test_grains_items(self):
        '''
        test grains.items with salt-ssh
        '''
        ret = self.run_function('grains.items')
        self.assertEqual(ret['kernel'], 'Linux')
        self.assertTrue(isinstance(ret, dict))

## Instruction:
Add darwin value for ssh grain items tests on MacOSX
## Code After:
from __future__ import absolute_import

# Import Salt Testing Libs
from tests.support.case import SSHCase
from tests.support.unit import skipIf

# Import Salt Libs
import salt.utils


@skipIf(salt.utils.is_windows(), 'salt-ssh not available on Windows')
class SSHGrainsTest(SSHCase):
    '''
    testing grains with salt-ssh
    '''
    def test_grains_items(self):
        '''
        test grains.items with salt-ssh
        '''
        ret = self.run_function('grains.items')
        grain = 'Linux'
        if salt.utils.platform.is_darwin():
            grain = 'Darwin'
        self.assertEqual(ret['kernel'], grain)
        self.assertTrue(isinstance(ret, dict))
