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

Unified Diff: telemetry/telemetry/internal/util/webpagereplay_unittest.py

Issue 2209443003: [Telemetry] Rename webpagereplay to wpr_server (Closed) Base URL: https://github.com/catapult-project/catapult@master
Patch Set: Update mock reference Created 4 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: telemetry/telemetry/internal/util/webpagereplay_unittest.py
diff --git a/telemetry/telemetry/internal/util/webpagereplay_unittest.py b/telemetry/telemetry/internal/util/webpagereplay_unittest.py
deleted file mode 100644
index 518e0d23baff42b69be6b35baf5b56951ba6e8ec..0000000000000000000000000000000000000000
--- a/telemetry/telemetry/internal/util/webpagereplay_unittest.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import sys
-import unittest
-
-from telemetry.internal.util import webpagereplay
-
-
-# pylint: disable=protected-access
-class CreateCommandTest(unittest.TestCase):
- def testHasDnsGivesDnsPort(self):
- expected_cmd_line = [
- sys.executable, 'replay.py', '--host=127.0.0.1',
- '--port=2', '--ssl_port=1', '--dns_port=0',
- '--use_closest_match', '--log_level=warning', '--extra_arg', 'foo.wpr']
- cmd_line = webpagereplay.ReplayServer._GetCommandLine(
- 'replay.py', '127.0.0.1', 2, 1, 0, ['--extra_arg'], 'foo.wpr')
- self.assertEqual(expected_cmd_line, cmd_line)
-
- def testNoDnsGivesNoDnsForwarding(self):
- expected_cmd_line = [
- sys.executable, 'replay.py', '--host=127.0.0.1',
- '--port=8080', '--ssl_port=8443', '--no-dns_forwarding',
- '--use_closest_match', '--log_level=warning', 'bar.wpr']
- cmd_line = webpagereplay.ReplayServer._GetCommandLine(
- 'replay.py', '127.0.0.1', 8080, 8443, None, [], 'bar.wpr')
- self.assertEqual(expected_cmd_line, cmd_line)
-
-
-# pylint: disable=protected-access
-class ParseLogFilePortsTest(unittest.TestCase):
- def testEmptyLinesGivesEmptyDict(self):
- log_lines = iter([])
- self.assertEqual(
- {},
- webpagereplay.ReplayServer._ParseLogFilePorts(log_lines))
-
- def testSingleMatchGivesSingleElementDict(self):
- log_lines = iter([
- 'extra stuff',
- '2014-09-27 17:04:27,11 WARNING HTTP server started on 127.0.0.1:5167',
- 'extra stuff',
- ])
- self.assertEqual(
- {'http': 5167},
- webpagereplay.ReplayServer._ParseLogFilePorts(log_lines))
-
- def testUnknownProtocolSkipped(self):
- log_lines = iter([
- '2014-09-27 17:04:27,11 WARNING FOO server started on 127.0.0.1:1111',
- '2014-09-27 17:04:27,12 WARNING HTTP server started on 127.0.0.1:5167',
- ])
- self.assertEqual(
- {'http': 5167},
- webpagereplay.ReplayServer._ParseLogFilePorts(log_lines))
-
- def testTypicalLogLinesGiveFullDict(self):
- log_lines = iter([
- 'extra',
- '2014-09-27 17:04:27,11 WARNING DNS server started on 127.0.0.1:2345',
- '2014-09-27 17:04:27,12 WARNING HTTP server started on 127.0.0.1:3456',
- '2014-09-27 17:04:27,13 WARNING HTTPS server started on 127.0.0.1:4567',
- ])
- self.assertEqual(
- {'dns': 2345, 'http': 3456, 'https': 4567},
- webpagereplay.ReplayServer._ParseLogFilePorts(log_lines))
« no previous file with comments | « telemetry/telemetry/internal/util/webpagereplay.py ('k') | telemetry/telemetry/internal/util/wp_server_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698