| Index: native_client_sdk/src/tools/tests/httpd_test.py
|
| diff --git a/native_client_sdk/src/tools/tests/httpd_test.py b/native_client_sdk/src/tools/tests/httpd_test.py
|
| index ff4ef5add215f290989d17f6f00f128cb2e7bb45..abc1cc3e7ef51b91fe5f91a76746680813d64d3f 100755
|
| --- a/native_client_sdk/src/tools/tests/httpd_test.py
|
| +++ b/native_client_sdk/src/tools/tests/httpd_test.py
|
| @@ -14,13 +14,13 @@ import urllib2
|
| SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
|
| CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR)))
|
| -MOCK_DIR = os.path.join(CHROME_SRC, "third_party", "pymock")
|
| +MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
|
|
|
| sys.path.append(TOOLS_DIR)
|
| sys.path.append(MOCK_DIR)
|
|
|
| import httpd
|
| -from mock import patch
|
| +from mock import patch, Mock
|
|
|
|
|
| class HTTPDTest(unittest.TestCase):
|
| @@ -38,6 +38,16 @@ class HTTPDTest(unittest.TestCase):
|
| self.assertFalse(self.server.process.is_alive())
|
|
|
|
|
| +class MainTest(unittest.TestCase):
|
| + @patch('httpd.LocalHTTPServer')
|
| + @patch('sys.stdout', Mock())
|
| + def testArgs(self, mock_server_ctor):
|
| + mock_server = Mock()
|
| + mock_server_ctor.return_value = mock_server
|
| + httpd.main(['-p', '123', '-C', 'dummy'])
|
| + mock_server_ctor.assert_called_once_with('dummy', 123)
|
| +
|
| +
|
| class RunTest(unittest.TestCase):
|
| def setUp(self):
|
| self.process = None
|
|
|