def testGetPublicInfo(self): """ Test method resopnse <code>application.getPublicInfo</code> """ jso = self.getPublicInfoResponse() appInfo = jso.cast() Assert.assertEquals(u"aebf2e22b6bcb3bbd95c180bb68b6df4", appInfo.getApiKey()) Assert.assertEquals(2, appInfo.getDevelopers().__len__())
def testFriendsAreFriends(self): """ Test response from method <code>friends.areFriends</code> """ jso = self.getAreFriendsResponse() areFriends = jso.cast() Assert.assertEquals(1, areFriends.__len__()) friendInfo = areFriends.get(0) Assert.assertTrue(friendInfo.getAreFriends())
def testFriendsGet(self): """ Test response from method <code>friends.get</code> """ friendList = self.getFriendList().cast() Assert.assertTrue(friendList.__len__() > 10) for i in range(0,friendList.__len__()): fmt = NumberFormat.getFormat(u"0") friendId = friendList.get(i) System.out.println(fmt.format(friendId))
def testParseErrorMessage(self): """ Parse an error response from facebook. """ errorMessage = self.getErrorResponse().cast() Assert.assertEquals(u"Include one of subj_id, album, or pids", errorMessage.getMessage()) userData = errorMessage.getUserData() Assert.assertNotNull(u"UserData null", userData) Assert.assertEquals(u"Error Code invalid", 100, userData.getErrorCode()) Assert.assertEquals(9, userData.getRequestArgs().__len__()) requestArgs = userData.getRequestArgs() for i in range(0,requestArgs.__len__()): kv = requestArgs.get(i) System.out.println(java.str(kv.getKey()) + u" = " + kv.getValue())
def testHasPermission(self): """ Test method <code>users.hasAppPermission</code> response. """ jso = self.getAppPermissionResponse() Assert.assertTrue(u"1".equals(java.str(jso)))