'''
Created on Nov 29, 2012

@author: dev
'''
import unittest
import httplib2
import json


class TestHandsetProfile(unittest.TestCase):


    def testGetHandsetProfile(self):
        
        request_uri = 'http://192.168.0.3:8080/hap/api/1.0/handsetProfile'
        
        h = httplib2.Http()
        resp,content = h.request(request_uri , 'GET')

        self.assertEqual('200', resp['status'])
        self.assertEqual('application/json', resp['content-type'])
        
        jsonContent = json.loads(content)
        
        self.assertIn('userInfo', jsonContent)
        self.assertIn('handsetInfo', jsonContent)
        self.assertIn('appList', jsonContent)
        
        print 'Reponse: ', resp
        print 'Content: ', content
        
        pass

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()