Ejemplo n.º 1
0
    def test_connect(self, mock_provider):
        mock_cookie = {'Cookie': 'cookie=testcookie'}
        mock_provider.return_value.auth_header.return_value = mock_cookie

        c = Client('server', 'user', 'pass')
        c.connect()

        self.assertEqual(c.headers, mock_cookie)
Ejemplo n.º 2
0
    def test_connect(self, mock_provider):
        mock_cookie = {'Cookie': 'cookie=testcookie'}
        mock_provider.return_value.auth_header.return_value = mock_cookie

        c = Client('server', 'user', 'pass')
        c.connect()

        self.assertTrue(
            all(item in c.session.headers.items()
                for item in mock_cookie.items()))