[tor-commits] [flashproxy/master] Add a test that all required response fields are present.

infinity0 at torproject.org infinity0 at torproject.org
Mon Oct 28 14:47:41 UTC 2013


commit 08c6e67105bb2b089fcb41bdbadacbb24012b684
Author: David Fifield <david at bamsoftware.com>
Date:   Thu Oct 17 01:22:04 2013 -0700

    Add a test that all required response fields are present.
    
    A previously existing test checked for "check-back-in"; also check
    "client" and "relay".
---
 facilitator/facilitator-test |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/facilitator/facilitator-test b/facilitator/facilitator-test
index a8fcbbc..ffeb87e 100755
--- a/facilitator/facilitator-test
+++ b/facilitator/facilitator-test
@@ -280,10 +280,12 @@ class FacilitatorProcTest(unittest.TestCase):
         reg = fac.get_reg(FACILITATOR_ADDR, self.IPV6_PROXY_ADDR, PROXY_TPS)
         self.assertEqual(reg["client"], fac.format_addr(self.IPV6_CLIENT_ADDR))
 
-    def test_check_back_in(self):
-        """Test that facilitator responses contain a CHECK-BACK-IN key with a
-        numeric value."""
-        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"], fac.format_addr(self.IPV4_CLIENT_ADDR))
+        self.assertEqual(reg["relay"], fac.format_addr(self.IPV4_RELAY_ADDR))
         self.assertGreater(int(reg["check-back-in"]), 0)
 
 #     def test_same_proxy(self):





More information about the tor-commits mailing list