async def METHOD_NAME(self, mock_cf):
    with NamedTemporaryFile() as tempfile:
        tempfile.close()
        temppath = Path(tempfile.name)
        temppath.write_text('cred-test')
        cred = client.CloudCredential(auth_type='jsonfile',
                                      attrs={'file': tempfile.name})
        jujudata = mock.MagicMock()
        c = Controller(jujudata=jujudata)
        c._connector = mock.Mock()
        up_creds = mock.AsyncMock()
        cloud_facade = mock_cf.from_connection()
        cloud_facade.version = 2
        cloud_facade.UpdateCredentials = up_creds
        await c.add_credential(
            name='name',
            credential=cred,
            cloud='cloud',
            owner='owner',
        )
        assert up_creds.called
        new_cred = up_creds.call_args[1]['credentials'][0].credential
        assert cred.attrs['file'] == tempfile.name
        assert new_cred.attrs['file'] == 'cred-test'