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

All Samples(16)  |  Call(16)  |  Derive(0)  |  Import(0)
This class is used by Client class to communicate with server.

src/p/y/python-binary-memcached-0.24/test/test_auth.py   python-binary-memcached(Download)
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0x81, 0, 0, 0, 0)
        server = bmemcached.client.Protocol('127.0.0.1')
        # can pass anything and it'll work
        self.assertTrue(server.authenticate('user', 'badpassword'))
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0, 0, 0, 0, [])
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertRaises(AuthenticationNotSupported,
                          server.authenticate, 'user', 'password')
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0x01, 0, 0, 0, ['PLAIN'])
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertRaises(MemcachedException,
                          server.authenticate, 'user', 'password')
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0, 0, 0, 0, ['PLAIN'])
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertTrue(server.authenticate('user', 'password'))
 
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0x08, 0, 0, 0, ['PLAIN'])
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertRaises(InvalidCredentials, server.authenticate,
                          'user', 'password2')

src/p/y/python-binary-memcached-HEAD/test/test_auth.py   python-binary-memcached(Download)
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0x81, 0, 0, 0, 0)
        server = bmemcached.client.Protocol('127.0.0.1')
        # can pass anything and it'll work
        self.assertTrue(server.authenticate('user', 'badpassword'))
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0, 0, 0, 0, [])
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertRaises(AuthenticationNotSupported,
                          server.authenticate, 'user', 'password')
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0x01, 0, 0, 0, ['PLAIN'])
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertRaises(MemcachedException,
                          server.authenticate, 'user', 'password')
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0, 0, 0, 0, ['PLAIN'])
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertTrue(server.authenticate('user', 'password'))
 
        """
        mocked_response.return_value = (0, 0, 0, 0, 0, 0x08, 0, 0, 0, ['PLAIN'])
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertRaises(InvalidCredentials, server.authenticate,
                          'user', 'password2')

src/p/y/python-binary-memcached-HEAD/test/test_server_parsing.py   python-binary-memcached(Download)
    def testNoPortGiven(self):
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertEqual(server.host, '127.0.0.1')
        self.assertEqual(server.port, 11211)
 
    def testInvalidPort(self):
        server = bmemcached.client.Protocol('127.0.0.1:blah')
    def testNonStandardPort(self):
        server = bmemcached.client.Protocol('127.0.0.1:5000')
        self.assertEqual(server.host, '127.0.0.1')
        self.assertEqual(server.port, 5000)
 

src/p/y/python-binary-memcached-0.24/test/test_server_parsing.py   python-binary-memcached(Download)
    def testNoPortGiven(self):
        server = bmemcached.client.Protocol('127.0.0.1')
        self.assertEqual(server.host, '127.0.0.1')
        self.assertEqual(server.port, 11211)
 
    def testInvalidPort(self):
        server = bmemcached.client.Protocol('127.0.0.1:blah')
    def testNonStandardPort(self):
        server = bmemcached.client.Protocol('127.0.0.1:5000')
        self.assertEqual(server.host, '127.0.0.1')
        self.assertEqual(server.port, 5000)