'''
tests for pkgrepo states
'''

# Import Salt Testing libs
from salttesting import skipIf
from salttesting.helpers import (
    destructiveTest,
    ensure_in_syspath,
)
ensure_in_syspath('../../')

# Import salt libs
import integration
import salt.utils


class PkgrepoTest(integration.ModuleCase,
                  integration.SaltReturnAssertsMixIn):
    '''
    pkgrepo state tests
    '''
    @destructiveTest
    @skipIf(salt.utils.is_windows(), 'minion is windows')
    def test_pkgrepo_01_managed(self):
        '''
        This is a destructive test as it adds a repository.
        '''
        ret = self.run_function('state.sls', mods='pkgrepo.managed')
        for state_id, state_result in ret.iteritems():
            self.assertSaltTrueReturn(dict([(state_id, state_result)]))

    @destructiveTest
    @skipIf(salt.utils.is_windows(), 'minion is windows')
    def test_pkgrepo_02_absent(self):
        '''
        This is a destructive test as it removes the repository added in the
        above test.
        '''
        ret = self.run_function('state.sls', mods='pkgrepo.absent')
        for state_id, state_result in ret.iteritems():
            self.assertSaltTrueReturn(dict([(state_id, state_result)]))


if __name__ == '__main__':
    from integration import run_tests
    run_tests(PkgrepoTest)

@@ -660,16 +660,236 @@
 naged')%0A
+        # If the below assert fails then no states were run, and the SLS in%0A        # tests/integration/files/file/base/pkgrepo/managed.sls needs to be%0A        # corrected.%0A        self.assertReturnNonEmptySaltType(ret)%0A
         
@@ -1314,16 +1314,235 @@
 bsent')%0A
+        # If the below assert fails then no states were run, and the SLS in%0A        # tests/integration/files/file/base/pkgrepo/absent.sls needs to be%0A        # corrected.%0A        self.assertReturnNonEmptySaltType(ret)%0A
         

Add an assert to ensure that the state.sls return dict isn't empty