'Tests that approvals expire after the correct time.'

def testApprovalExpiry(self):

    client_id = ('C.%016X' % 0)
    self.assertRaises(grr_api_errors.AccessForbiddenError, self.api.Client(client_id).File('fs/os/foo').Get)
    with test_lib.FakeTime(100.0, increment=0.001):
        self.RequestAndGrantClientApproval(client_id, self.token)
        self.api.Client(client_id).File('fs/os/foo').Get()
    token_expiry = config.CONFIG['ACL.token_expiry']
    self.ClearCache()
    with test_lib.FakeTime(((100.0 + token_expiry) - 100.0)):
        self.api.Client(client_id).File('fs/os/foo').Get()
    self.ClearCache()
    with test_lib.FakeTime(((100.0 + token_expiry) + 100.0)):
        self.assertRaises(grr_api_errors.AccessForbiddenError, self.api.Client(client_id).File('fs/os/foo').Get)
