def testGetClientIdForRequestWithSession(self):
    track = 'stable'
    os_version = '10.6.6'
    client_id = 'client_id'
    client_id_dict = {'track': track, 'os_version': os_version}
    session = self.mox.CreateMockAnything()
    session.uuid = 'uuid'
    request = self.mox.CreateMockAnything()
    request.headers = self.mox.CreateMockAnything()

    request.headers.get('X-munki-client-id', '').AndReturn(client_id)
    self.mox.StubOutWithMock(handlers.common, 'ParseClientId')
    handlers.common.ParseClientId(client_id, uuid=session.uuid).AndReturn(
        client_id_dict)

    self.mox.ReplayAll()
    r = handlers.GetClientIdForRequest(
        request, session=session, client_id_str='')
    self.assertEqual(r, client_id_dict)
    self.mox.VerifyAll()
Tests GetClientIdForRequest().
dataset/ETHPy150Open google/simian/src/tests/simian/mac/munki/handlers/__init___test.py/HandlersTest.testGetClientIdForRequestWithSession