Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/b/a/babble.server-1.1/babble/server/tests/test_chatservice.py   babble.server(Download)
        # Delete the Conversations folder to check that it gets recreated.
        s.manage_delObjects(['conversations'])
        um = json.loads(s.getMessages('recipient', 'secret', '*', [], config.NULL_DATE, None,))
        self.assertEqual(um['status'], config.SUCCESS)
        self.assertTrue(hasattr(s, 'conversations'))
 
        um = s.getMessages('recipient', 'secret', '*', [], config.NULL_DATE, None)
        self.assertEqual(response['status'], config.AUTH_FAIL)
 
        um = json.loads(s.getNewMessages('recipient', 'wrongpass', config.NULL_DATE))
        self.assertEqual(um['status'], config.AUTH_FAIL)
 
        um = json.loads(s.getUnclearedMessages('recipient', 'wrongpass', 'sender', [], config.NULL_DATE, False))
        message_timestamp = response['last_msg_date']
 
        um = json.loads(s.getNewMessages( 'recipient', 'secret', config.NULL_DATE))
        self.assertEqual(um['status'], config.SUCCESS)
        # The returned datastructure looks as follows:

src/b/a/babble.server-1.1/babble/server/tests/stress_test.py   babble.server(Download)
            chatservice.sendMessage(self.user, self.user, self.buddy, 'message%s'%i)
            transaction.commit()
            messages = json.loads(chatservice.getUnclearedMessages(self.user, self.user, self.buddy, config.NULL_DATE))
            transaction.commit()
            # print '%s -> %s: %s' % (self.buddy, self.user, len(messages['messages'].values()[0]))

src/b/a/babble.client-2.0/src/babble/client/tests/test_chat.py   babble.client(Download)
 
        member = self.mtool.getAuthenticatedMember()
        resp = traverse('@@babblechat/poll')(member.getId(), config.NULL_DATE)
        resp = json.loads(resp)
        self.assertEquals(resp['status'], config.AUTH_FAIL)
 
        member = self.mtool.getAuthenticatedMember()
        resp = traverse('@@babblechat/poll')(member.getId(), config.NULL_DATE)
        resp = json.loads(resp)
        self.assertEquals(resp['status'], config.AUTH_FAIL)
        # Poll for username1 and see if we got our message
        self.login(name=username1)
        resp = traverse('@@babblechat/poll')(username1, config.NULL_DATE)
        resp = json.loads(resp)
        self.assertEquals(resp['status'], config.SUCCESS)