forked from mmerickel/anykeystore
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic test setup for creating storage mechanisms.
- Loading branch information
Showing
6 changed files
with
63 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import unittest | ||
|
||
class TestStore(unittest.TestCase): | ||
|
||
def test_create_store(self): | ||
from anykeystore import create_store | ||
store = create_store('memory') | ||
|
||
from anykeystore.backends.memory import MemoryStore | ||
self.assertTrue(isinstance(store, MemoryStore)) | ||
|
||
def test_create_store_from_settings(self): | ||
from anykeystore import create_store_from_settings | ||
store = create_store_from_settings({'store': 'memory'}) | ||
|
||
from anykeystore.backends.memory import MemoryStore | ||
self.assertTrue(isinstance(store, MemoryStore)) | ||
|
||
def test_create_store_from_settings_with_prefix(self): | ||
from anykeystore import create_store_from_settings | ||
store = create_store_from_settings( | ||
{'any.store': 'memory'}, prefix='any.') | ||
|
||
from anykeystore.backends.memory import MemoryStore | ||
self.assertTrue(isinstance(store, MemoryStore)) |
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,6 @@ | ||
[nosetests] | ||
match=^test | ||
where=anykeystore | ||
nocapture=1 | ||
cover-package=anykeystore | ||
cover-erase=1 |
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,22 @@ | ||
[tox] | ||
envlist = | ||
py26,py27,py32,pypy,cover | ||
|
||
[testenv] | ||
commands = | ||
python setup.py test -q | ||
|
||
[testenv:cover] | ||
basepython = | ||
python2.6 | ||
commands = | ||
python setup.py nosetests --with-xunit --with-xcoverage | ||
deps = | ||
nose | ||
coverage | ||
nosexcover | ||
|
||
# we separate coverage into its own testenv because a) "last run wins" wrt | ||
# cobertura jenkins reporting and b) pypy and jython can't handle any | ||
# combination of versions of coverage and nosexcover that i can find. | ||
# coverage==3.4 is required by nosexcover. |