-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e31de7
commit 4c9b7f5
Showing
9 changed files
with
74 additions
and
86 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
import shutil | ||
|
||
from unittest2 import TestCase | ||
|
||
|
||
class BaseTestCase(TestCase): | ||
module_name = 'test_app' | ||
tmp_file = '%s/__init__.py' % module_name | ||
|
||
def setUp(self): | ||
if not os.path.exists(self.module_name): | ||
os.mkdir(self.module_name) | ||
|
||
self.initial_init_content = [ | ||
'"""A test app"""', | ||
'', | ||
"__version__ = '0.0.1'", | ||
"__url__ = 'https://github.com/someuser/%s'" % self.module_name, | ||
"__author__ = 'Some User'", | ||
"__email__ = 'someuser@gmail.com'" | ||
] | ||
with open(self.tmp_file, 'w') as init_file: | ||
init_file.write('\n'.join(self.initial_init_content)) | ||
|
||
def tearDown(self): | ||
if os.path.exists(self.tmp_file): | ||
shutil.rmtree(self.module_name) |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from unittest2 import TestCase | ||
from changes import util | ||
|
||
|
||
class UtilTestCase(TestCase): | ||
|
||
def test_extract(self): | ||
self.assertEquals( | ||
{'a': 1, 'b': 2}, | ||
util.extract( | ||
{'a': 1, 'b': 2, 'c': 3}, | ||
['a', 'b'] | ||
) | ||
) |