From f4c2406d2c6348eaf657ce8b82e85b0ad7b7c891 Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Tue, 5 Jan 2016 09:05:24 -0800 Subject: [PATCH] Moving devshell module to contrib. See discussion in #370 for context. --- docs/source/oauth2client.contrib.devshell.rst | 7 ++++++ docs/source/oauth2client.contrib.rst | 1 + docs/source/oauth2client.devshell.rst | 7 ------ docs/source/oauth2client.rst | 1 - oauth2client/{ => contrib}/devshell.py | 0 tests/{ => contrib}/test_devshell.py | 22 +++++++++---------- 6 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 docs/source/oauth2client.contrib.devshell.rst delete mode 100644 docs/source/oauth2client.devshell.rst rename oauth2client/{ => contrib}/devshell.py (100%) rename tests/{ => contrib}/test_devshell.py (92%) diff --git a/docs/source/oauth2client.contrib.devshell.rst b/docs/source/oauth2client.contrib.devshell.rst new file mode 100644 index 000000000..20d5c4185 --- /dev/null +++ b/docs/source/oauth2client.contrib.devshell.rst @@ -0,0 +1,7 @@ +oauth2client.contrib.devshell module +==================================== + +.. automodule:: oauth2client.contrib.devshell + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/oauth2client.contrib.rst b/docs/source/oauth2client.contrib.rst index d04586a2d..6ef89743d 100644 --- a/docs/source/oauth2client.contrib.rst +++ b/docs/source/oauth2client.contrib.rst @@ -14,6 +14,7 @@ Submodules .. toctree:: oauth2client.contrib.appengine + oauth2client.contrib.devshell oauth2client.contrib.django_orm oauth2client.contrib.flask_util oauth2client.contrib.gce diff --git a/docs/source/oauth2client.devshell.rst b/docs/source/oauth2client.devshell.rst deleted file mode 100644 index 1861ec67b..000000000 --- a/docs/source/oauth2client.devshell.rst +++ /dev/null @@ -1,7 +0,0 @@ -oauth2client.devshell module -============================ - -.. automodule:: oauth2client.devshell - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/oauth2client.rst b/docs/source/oauth2client.rst index 9e817cda9..25d3ce05c 100644 --- a/docs/source/oauth2client.rst +++ b/docs/source/oauth2client.rst @@ -16,7 +16,6 @@ Submodules oauth2client.client oauth2client.clientsecrets oauth2client.crypt - oauth2client.devshell oauth2client.file oauth2client.service_account oauth2client.tools diff --git a/oauth2client/devshell.py b/oauth2client/contrib/devshell.py similarity index 100% rename from oauth2client/devshell.py rename to oauth2client/contrib/devshell.py diff --git a/tests/test_devshell.py b/tests/contrib/test_devshell.py similarity index 92% rename from tests/test_devshell.py rename to tests/contrib/test_devshell.py index e3938f902..25d23fd7c 100644 --- a/tests/test_devshell.py +++ b/tests/contrib/test_devshell.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Tests for oauth2client.devshell.""" +"""Tests for oauth2client.contrib.devshell.""" import json import os @@ -25,13 +25,13 @@ from oauth2client._helpers import _from_bytes from oauth2client._helpers import _to_bytes from oauth2client.client import save_to_well_known_file -from oauth2client.devshell import _SendRecv -from oauth2client.devshell import CREDENTIAL_INFO_REQUEST_JSON -from oauth2client.devshell import CommunicationError -from oauth2client.devshell import CredentialInfoResponse -from oauth2client.devshell import DEVSHELL_ENV -from oauth2client.devshell import DevshellCredentials -from oauth2client.devshell import NoDevshellServer +from oauth2client.contrib.devshell import _SendRecv +from oauth2client.contrib.devshell import CREDENTIAL_INFO_REQUEST_JSON +from oauth2client.contrib.devshell import CommunicationError +from oauth2client.contrib.devshell import CredentialInfoResponse +from oauth2client.contrib.devshell import DEVSHELL_ENV +from oauth2client.contrib.devshell import DevshellCredentials +from oauth2client.contrib.devshell import NoDevshellServer class TestCredentialInfoResponse(unittest.TestCase): @@ -66,7 +66,7 @@ def test_constructor_full_list(self): class Test_SendRecv(unittest.TestCase): def test_port_zero(self): - with mock.patch('oauth2client.devshell.os') as os_mod: + with mock.patch('oauth2client.contrib.devshell.os') as os_mod: os_mod.getenv = mock.MagicMock(name='getenv', return_value=0) self.assertRaises(NoDevshellServer, _SendRecv) os_mod.getenv.assert_called_once_with(DEVSHELL_ENV, 0) @@ -79,10 +79,10 @@ def test_no_newline_in_received_header(self): sock.recv(6).decode = mock.MagicMock( name='decode', return_value=header_without_newline) - with mock.patch('oauth2client.devshell.os') as os_mod: + with mock.patch('oauth2client.contrib.devshell.os') as os_mod: os_mod.getenv = mock.MagicMock(name='getenv', return_value=non_zero_port) - with mock.patch('oauth2client.devshell.socket') as socket: + with mock.patch('oauth2client.contrib.devshell.socket') as socket: socket.socket = mock.MagicMock(name='socket', return_value=sock) self.assertRaises(CommunicationError, _SendRecv)