예제 #1
0
 def test_activate_client(self):
     p = PostgresClientProtocol()
     c1, c2 = object(), object()
     
     p.attachClient(c1)
     p.attachClient(c2)
     self.assertEqual(p.currentClient(), c2)
     p.activateClient(c1)
     self.assertEqual(p.currentClient(), c1)
예제 #2
0
    def test_activate_client(self):
        p = PostgresClientProtocol()
        c1, c2 = object(), object()

        p.attachClient(c1)
        p.attachClient(c2)
        self.assertEqual(p.currentClient(), c2)
        p.activateClient(c1)
        self.assertEqual(p.currentClient(), c1)
예제 #3
0
    def test_attaching_clients(self):
        p = PostgresClientProtocol()
        c1, c2 = object(), object()

        self.assertEqual(p.currentClient(), None)

        p.attachClient(c1)
        self.assertEqual(p.currentClient(), c1)

        p.attachClient(c2)
        self.assertEqual(p.currentClient(), c2)

        p.detachClient(c2)
        self.assertEqual(p.currentClient(), c1)
예제 #4
0
    def test_attaching_clients(self):
        p = PostgresClientProtocol()
        c1, c2 = object(), object()

        self.assertEqual(p.currentClient(), None)

        p.attachClient(c1)
        self.assertEqual(p.currentClient(), c1)

        p.attachClient(c2)
        self.assertEqual(p.currentClient(), c2)

        p.detachClient(c2)
        self.assertEqual(p.currentClient(), c1)