Пример #1
0
    def test_withdraw(self):
        """
        Check that withdrawn services are no longer visible in BROKER.
        """
        response = register("testService1", 12311)
        self.assertEqual(response, "OK")

        svcs = list(broker("testService1"))
        self.assertEqual(len(svcs), 1)

        withdraw("testService1", 12311)

        svcs = list(broker("testService1"))
        self.assertEqual(len(svcs), 0)
Пример #2
0
    def test_withdraw(self):
        """
        Check that withdrawn services are no longer visible in BROKER.
        """
        response = register("testService1", 12311)
        self.assertEqual(response, "OK")

        svcs = list(broker("testService1"))
        self.assertEqual(len(svcs), 1)

        withdraw("testService1", 12311)

        svcs = list(broker("testService1"))
        self.assertEqual(len(svcs), 0)
Пример #3
0
    def test_withdraw_altport(self):
        """
        Withdrawing services on other ports should not affect this one,
        even if they have the same name.
        """
        response = register("testService1", 12311)
        self.assertEqual(response, "OK")

        response = register("testService1", 12312)
        self.assertEqual(response, "OK")

        svcs = list(broker("testService1"))
        self.assertEqual(len(svcs), 2)

        withdraw("testService1", 12312)

        svcs = list(broker("testService1"))
        self.assertEqual(len(svcs), 1)
Пример #4
0
    def test_withdraw_altport(self):
        """
        Withdrawing services on other ports should not affect this one,
        even if they have the same name.
        """
        response = register("testService1", 12311)
        self.assertEqual(response, "OK")

        response = register("testService1", 12312)
        self.assertEqual(response, "OK")

        svcs = list(broker("testService1"))
        self.assertEqual(len(svcs), 2)

        withdraw("testService1", 12312)

        svcs = list(broker("testService1"))
        self.assertEqual(len(svcs), 1)
Пример #5
0
 def test_withdraw_nonexistent(self):
     """
     Even if a service wasn't registered, you should be able to WITHDRAW it.
     """
     self.assertTrue(withdraw("testServiceNonExistent", 12311))
Пример #6
0
 def test_withdraw_nonexistent(self):
     """
     Even if a service wasn't registered, you should be able to WITHDRAW it.
     """
     self.assertTrue(withdraw("testServiceNonExistent", 12311))