Example #1
0
    def test_list_success(self):
        """
        Tests the return of the list function containing bank entries.
        """
        # Create a temporary cache dir
        tmp_dir = tempfile.mkdtemp(dir=integration.SYS_TMP_DIR)

        # Use the helper function to create the cache file using localfs.store()
        self._create_tmp_cache_file(tmp_dir, salt.payload.Serial(self))

        # Now test the return of the list function
        with patch.dict(localfs.__opts__, {"cachedir": tmp_dir}):
            self.assertEqual(localfs.list(bank="bank"), ["key.p"])
Example #2
0
    def test_list_success(self):
        '''
        Tests the return of the list function containing bank entries.
        '''
        # Create a temporary cache dir
        tmp_dir = tempfile.mkdtemp(dir=integration.SYS_TMP_DIR)

        # Use the helper function to create the cache file using localfs.store()
        self._create_tmp_cache_file(tmp_dir, salt.payload.Serial(self))

        # Now test the return of the list function
        with patch.dict(localfs.__opts__, {'cachedir': tmp_dir}):
            self.assertEqual(localfs.list(bank='bank'), ['key.p'])
Example #3
0
 def test_list_no_base_dir(self):
     """
     Tests that the list function returns an empty list if the bank directory
     doesn't exist.
     """
     self.assertEqual(localfs.list(bank=""), [])
Example #4
0
 def test_list_no_base_dir(self):
     '''
     Tests that the list function returns an empty list if the bank directory
     doesn't exist.
     '''
     self.assertEqual(localfs.list(bank=''), [])