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

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/f/l/flashproxy-HEAD/facilitator/facilitator-test.py   flashproxy(Download)
    def test_af_v4_v4(self):
        """Test that IPv4 proxies can get IPv4 clients."""
        fac.put_reg(FACILITATOR_ADDR, self.IPV4_CLIENT_ADDR, CLIENT_TP)
        fac.put_reg(FACILITATOR_ADDR, self.IPV6_CLIENT_ADDR, CLIENT_TP)
        reg = fac.get_reg(FACILITATOR_ADDR, self.IPV4_PROXY_ADDR, PROXY_TPS)
    def test_af_v4_v6(self):
        """Test that IPv4 proxies do not get IPv6 clients."""
        fac.put_reg(FACILITATOR_ADDR, self.IPV6_CLIENT_ADDR, CLIENT_TP)
        reg = fac.get_reg(FACILITATOR_ADDR, self.IPV4_PROXY_ADDR, PROXY_TPS)
        self.assertEqual(reg["client"], "")
 
    def test_af_v6_v4(self):
        """Test that IPv6 proxies do not get IPv4 clients."""
        fac.put_reg(FACILITATOR_ADDR, self.IPV4_CLIENT_ADDR, CLIENT_TP)
        reg = fac.get_reg(FACILITATOR_ADDR, self.IPV6_PROXY_ADDR, PROXY_TPS)
    def test_af_v6_v6(self):
        """Test that IPv6 proxies can get IPv6 clients."""
        fac.put_reg(FACILITATOR_ADDR, self.IPV4_CLIENT_ADDR, CLIENT_TP)
        fac.put_reg(FACILITATOR_ADDR, self.IPV6_CLIENT_ADDR, CLIENT_TP)
        reg = fac.get_reg(FACILITATOR_ADDR, self.IPV6_PROXY_ADDR, PROXY_TPS)
    def test_fields(self):
        """Test that facilitator responses contain all the required fields."""
        fac.put_reg(FACILITATOR_ADDR, self.IPV4_CLIENT_ADDR, CLIENT_TP)
        reg = fac.get_reg(FACILITATOR_ADDR, self.IPV4_PROXY_ADDR, PROXY_TPS)
        self.assertEqual(reg["client"], format_addr(self.IPV4_CLIENT_ADDR))