def test_filemgr_list_files(self,
                                mock_file,
                                mock_api,
                                mock_creds,
                                mock_cfg):
        """Test list_files"""

        mgr = FileManager(mock_creds, cfg=mock_cfg)

        resp = mock.create_autospec(Response)
        resp.success = False
        resp.result = RestCallException(None, "test", None)
        mgr._client.list_files.return_value = resp

        with self.assertRaises(RestCallException):
            test = mgr.list_files()
        self.assertTrue(mgr._client.list_files.called)
        self.assertFalse(mock_file.called)

        resp.success = True
        resp.result = ["test", True, 42, None]
        test = mgr.list_files()
        self.assertIsInstance(test, list)
        mock_file.assert_any_call(mgr._client, "test")
        mock_file.assert_any_call(mgr._client, True)
        mock_file.assert_any_call(mgr._client, 42)
        mock_file.assert_any_call(mgr._client, None)
        self.assertEqual(mock_file.call_count, 4)
    def test_filemgr_list_files(self, mock_file, mock_api, mock_creds,
                                mock_cfg):
        """Test list_files"""

        mgr = FileManager(mock_creds, cfg=mock_cfg)

        resp = mock.create_autospec(Response)
        resp.success = False
        resp.result = RestCallException(None, "test", None)
        mgr._client.list_files.return_value = resp

        with self.assertRaises(RestCallException):
            test = mgr.list_files()
        self.assertTrue(mgr._client.list_files.called)
        self.assertFalse(mock_file.called)

        resp.success = True
        resp.result = ["test", True, 42, None]
        test = mgr.list_files()
        self.assertIsInstance(test, list)
        mock_file.assert_any_call(mgr._client, "test")
        mock_file.assert_any_call(mgr._client, True)
        mock_file.assert_any_call(mgr._client, 42)
        mock_file.assert_any_call(mgr._client, None)
        self.assertEqual(mock_file.call_count, 4)