diff options
Diffstat (limited to 'tests/test_tools.py')
-rw-r--r-- | tests/test_tools.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/test_tools.py b/tests/test_tools.py index 52191f0..369f567 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -12,20 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -import argparse import socket import sys import threading -import unittest import mock from six.moves.urllib import request +import unittest2 from oauth2client import client from oauth2client import tools +try: + import argparse +except ImportError: # pragma: NO COVER + raise unittest2.SkipTest('argparase unavailable.') -class TestClientRedirectServer(unittest.TestCase): + +class TestClientRedirectServer(unittest2.TestCase): """Test the ClientRedirectServer and ClientRedirectHandler classes.""" def test_ClientRedirectServer(self): @@ -47,7 +51,7 @@ class TestClientRedirectServer(unittest.TestCase): self.assertEqual(httpd.query_params.get('code'), code) -class TestRunFlow(unittest.TestCase): +class TestRunFlow(unittest2.TestCase): def setUp(self): self.server = mock.Mock() @@ -183,6 +187,6 @@ class TestRunFlow(unittest.TestCase): self.assertFalse(self.server.handle_request.called) -class TestMessageIfMissing(unittest.TestCase): +class TestMessageIfMissing(unittest2.TestCase): def test_message_if_missing(self): self.assertIn('somefile.txt', tools.message_if_missing('somefile.txt')) |