def METHOD_NAME(self, resign, sample_service):
    from app import signer_api_key
    with set_signer_secret_key(signer_api_key, ["k1", "k2"]):
        initial_key = create_api_key(service=sample_service)
        secret = initial_key.secret
        _secret = initial_key._secret
    with set_signer_secret_key(signer_api_key, ["k2", "k3"]):
        resign_api_keys(resign=resign)
        api_key = ApiKey.query.get(initial_key.id)
        assert api_key.secret == secret  # unsigned value is the same
        if resign:
            assert api_key._secret != _secret  # signature is different
        else:
            assert api_key._secret == _secret  # signature is the same