old_contents: # Import salt libs
  import integration
  
  class PillarModuleTest(integration.ModuleCase):
      '''
      Validate the pillar module
      '''
      def test_data(self):
          '''
          pillar.data
          '''
          grains = self.run_function('grains.items')
          pillar = self.run_function('pillar.data')
          self.assertEqual(pillar['os'], grains['os'])
          self.assertEqual(pillar['monty'], 'python')
          if grains['os'] == 'Fedora':
              self.assertEqual(pillar['class'], 'redhat')
          else:
              self.assertEqual(pillar['class'], 'other')
  
  
new_contents: # Import salt libs
  import integration
  
  class PillarModuleTest(integration.ModuleCase):
      '''
      Validate the pillar module
      '''
      def test_data(self):
          '''
          pillar.data
          '''
          grains = self.run_function('grains.items')
          pillar = self.run_function('pillar.data')
          self.assertEqual(pillar['os'], grains['os'])
          self.assertEqual(pillar['monty'], 'python')
          if grains['os'] == 'Fedora':
              self.assertEqual(pillar['class'], 'redhat')
          else:
              self.assertEqual(pillar['class'], 'other')
  
      def test_ext_cmd_yaml(self):
          '''
          pillar.data for ext_pillar cmd.yaml
          '''
          self.assertEqual(
                  self.run_function('pillar.data')['ext_spam'], 'eggs'
                  )
  
subject: Add test for ext_pillar