Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
0be531db
Commit
0be531db
authored
Apr 15, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make some of the optional requirements optional for testing -- we'll skip the tests instead
parent
abb93d91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
v2/test-requirements.txt
+4
-2
v2/test/plugins/test_cache.py
+20
-2
No files found.
v2/test-requirements.txt
View file @
0be531db
...
...
@@ -5,8 +5,10 @@ jinja2
httplib2
passlib
six
python-memcached
redis
# These are needed for various optional features
#python-memcached
#redis
# Test requirements
unittest2
...
...
v2/test/plugins/test_cache.py
View file @
0be531db
...
...
@@ -21,9 +21,25 @@ __metaclass__ = type
from
ansible.compat.tests
import
unittest
from
ansible.plugins.cache.base
import
BaseCacheModule
from
ansible.plugins.cache.memcached
import
CacheModule
as
MemcachedCache
from
ansible.plugins.cache.memory
import
CacheModule
as
MemoryCache
from
ansible.plugins.cache.redis
import
CacheModule
as
RedisCache
HAVE_MEMCACHED
=
True
try
:
import
memcached
except
ImportError
:
HAVE_MEMCACHED
=
False
else
:
# Use an else so that the only reason we skip this is for lack of
# memcached, not errors importing the plugin
from
ansible.plugins.cache.memcached
import
CacheModule
as
MemcachedCache
HAVE_REDIS
=
True
try
:
import
redis
except
ImportError
:
HAVE_REDIS
=
False
else
:
from
ansible.plugins.cache.redis
import
CacheModule
as
RedisCache
class
TestAbstractClass
(
unittest
.
TestCase
):
...
...
@@ -72,11 +88,13 @@ class TestAbstractClass(unittest.TestCase):
self
.
assertIsInstance
(
CacheModule3
(),
CacheModule3
)
@unittest.skipUnless
(
HAVE_MEMCACHED
)
def
test_memcached_cachemodule
(
self
):
self
.
assertIsInstance
(
MemcachedCache
(),
MemcachedCache
)
def
test_memory_cachemodule
(
self
):
self
.
assertIsInstance
(
MemoryCache
(),
MemoryCache
)
@unittest.skipUnless
(
HAVE_REDIS
)
def
test_redis_cachemodule
(
self
):
self
.
assertIsInstance
(
RedisCache
(),
RedisCache
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment