def test_list_master_success(self):
        files = ['cheesse/saltines.sls', 'cheese/biscuits.sls']
        ret = files

        class MockFileClient(object):
            def file_list(self, saltenv, prefix):
                return files

        mock_file_client = MockFileClient()
        with patch.dict(cp.__context__, {'cp.fileclient': mock_file_client}):
            self.assertEqual(cp.list_master(), ret)
Test if list_master succeeds.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/cp_test.py/CpTestCase.test_list_master_success