def authorize(proposal, trusted_approval): return trusted_approval is not None and proposal == trusted_approval if __name__ == '__main__': intent = ('test', 'destination-A', 1000) assert not authorize(intent, None) assert not authorize(('test', 'destination-B', 1000), intent) assert authorize(intent, intent)