def test_set_object_token(self):
    object_PHID = 'PHID-DREV-abcdef'

    def assert_token_give_called(token_PHID):
        self.phab.token.give.assert_called_with(objectPHID=object_PHID, tokenPHID=token_PHID)
    self.phab.set_object_token(object_PHID)
    assert_token_give_called('')
    token_PHID = 'PHID-TOKN-like-1'
    self.phab.set_object_token(object_PHID, token_PHID)
    assert_token_give_called(token_PHID)
def test_set_object_token(self):
    object_PHID = 'PHID-DREV-abcdef'

    def assert_token_give_called(token_PHID):
        self.phab.token.give.assert_called_with(objectPHID=object_PHID, tokenPHID=token_PHID)
    self.phab.set_object_token(object_PHID)
    assert_token_give_called()
    token_PHID = 'PHID-TOKN-like-1'
    self.phab.set_object_token(object_PHID, token_PHID)
    assert_token_give_called(token_PHID)