Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: media/tools/constrained_network_server/cns_test.py

Issue 10824173: Enable CNS to serve files from different port. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/tools/constrained_network_server/cns_test.py
diff --git a/media/tools/constrained_network_server/cns_test.py b/media/tools/constrained_network_server/cns_test.py
index 0a6e995120792d7e8be7a9a46c7d34bdcc7f0131..dafc1d876377a1dabd2ae960523febd405554070 100755
--- a/media/tools/constrained_network_server/cns_test.py
+++ b/media/tools/constrained_network_server/cns_test.py
@@ -36,7 +36,7 @@ class PortAllocatorTest(unittest.TestCase):
self._MockTrafficControl()
def tearDown(self):
- self._pa.Cleanup(_INTERFACE, all_ports=True)
DaleCurtis 2012/08/07 23:53:57 Is this no longer necessary / incorrect?
shadi 2012/08/08 22:55:49 Not necessary, Cleanup() does a clean up on alloca
+ self._pa.Cleanup(all_ports=True)
# Ensure ports are cleaned properly.
self.assertEquals(self._pa._ports, {})
time.time = self._old_time
@@ -117,7 +117,11 @@ class PortAllocatorTest(unittest.TestCase):
class ConstrainedNetworkServerTest(unittest.TestCase):
- """End to end tests for ConstrainedNetworkServer system."""
+ """End to end tests for ConstrainedNetworkServer system.
+
+ These tests require root access and run the cherrypy server along with
+ tc/iptables commands.
+ """
# Amount of time to wait for the CNS to start up.
_SERVER_START_SLEEP_SECS = 1
@@ -192,8 +196,8 @@ class ConstrainedNetworkServerTest(unittest.TestCase):
self.assertTrue(time.time() - now > self._LATENCY_TEST_SECS)
# Verify the server properly redirected the URL.
- self.assertEquals(f.geturl(), base_url.replace(
- str(cns._DEFAULT_SERVING_PORT), str(cns._DEFAULT_CNS_PORT_RANGE[0])))
+ self.assertTrue(f.geturl().startswith(base_url.replace(
+ str(cns._DEFAULT_SERVING_PORT), str(cns._DEFAULT_CNS_PORT_RANGE[0]))))
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698