This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using unittest2 for extended unit test capabilities in python 2.6.
- Loading branch information
Showing
8 changed files
with
39 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
import os | ||
import pickle | ||
import sys | ||
import unittest | ||
import unittest2 | ||
# Mock a Django environment | ||
from django.conf import global_settings | ||
|
||
|
@@ -60,7 +60,7 @@ class DjangoOrmTestApp(AppConfig): | |
__author__ = '[email protected] (Conley Owens)' | ||
|
||
|
||
class TestCredentialsField(unittest.TestCase): | ||
class TestCredentialsField(unittest2.TestCase): | ||
|
||
def setUp(self): | ||
self.fake_model = FakeCredentialsModel() | ||
|
@@ -112,7 +112,7 @@ def test_credentials_without_null(self): | |
self.assertTrue(credentials.null) | ||
|
||
|
||
class TestFlowField(unittest.TestCase): | ||
class TestFlowField(unittest2.TestCase): | ||
|
||
class FakeFlowModel(models.Model): | ||
flow = FlowField() | ||
|
@@ -163,7 +163,7 @@ def test_flow_with_null(self): | |
self.assertTrue(flow.null) | ||
|
||
|
||
class TestStorage(unittest.TestCase): | ||
class TestStorage(unittest2.TestCase): | ||
|
||
def setUp(self): | ||
access_token = 'foo' | ||
|
@@ -320,4 +320,4 @@ def __init__(self, set_store=False, *args, **kwargs): | |
|
||
|
||
if __name__ == '__main__': # pragma: NO COVER | ||
unittest.main() | ||
unittest2.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
import datetime | ||
import keyring | ||
import threading | ||
import unittest | ||
import unittest2 | ||
|
||
import mock | ||
|
||
|
@@ -29,7 +29,7 @@ | |
__author__ = '[email protected] (Joe Gregorio)' | ||
|
||
|
||
class KeyringStorageTests(unittest.TestCase): | ||
class KeyringStorageTests(unittest2.TestCase): | ||
|
||
def test_constructor(self): | ||
service_name = 'my_unit_test' | ||
|
@@ -172,4 +172,4 @@ def release(self): | |
|
||
|
||
if __name__ == '__main__': # pragma: NO COVER | ||
unittest.main() | ||
unittest2.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
"""Tests for oauth2client.contrib.xsrfutil.""" | ||
|
||
import base64 | ||
import unittest | ||
import unittest2 | ||
|
||
import mock | ||
|
||
|
@@ -37,7 +37,7 @@ | |
__author__ = '[email protected] (Joe Gregorio)' | ||
|
||
|
||
class Test_generate_token(unittest.TestCase): | ||
class Test_generate_token(unittest2.TestCase): | ||
|
||
def test_bad_positional(self): | ||
# Need 2 positional arguments. | ||
|
@@ -111,7 +111,7 @@ def test_with_system_time(self): | |
self.assertEqual(token, expected_token) | ||
|
||
|
||
class Test_validate_token(unittest.TestCase): | ||
class Test_validate_token(unittest2.TestCase): | ||
|
||
def test_bad_positional(self): | ||
# Need 3 positional arguments. | ||
|
@@ -218,7 +218,7 @@ def test_success(self): | |
when=token_time) | ||
|
||
|
||
class XsrfUtilTests(unittest.TestCase): | ||
class XsrfUtilTests(unittest2.TestCase): | ||
"""Test xsrfutil functions.""" | ||
|
||
def testGenerateAndValidateToken(self): | ||
|
@@ -294,4 +294,4 @@ def testGenerateAndValidateToken(self): | |
|
||
|
||
if __name__ == '__main__': # pragma: NO COVER | ||
unittest.main() | ||
unittest2.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters