Skip to content

Commit

Permalink
Adds unit test of backend_config module.
Browse files Browse the repository at this point in the history
Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>
  • Loading branch information
mkouhei committed Jul 2, 2015
1 parent cc363cc commit 2f6ea28
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions pgraph/tests/test_backend_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
"""pgraph.tests.test_config module."""
import sys
import unittest
if sys.version_info < (3, 0):
# pylint: disable=no-name-in-module,import-error
from test.test_support import EnvironmentVarGuard
else:
from test.support import EnvironmentVarGuard


class BackednConfigTests(unittest.TestCase):

"""Backend config unit tests."""

def test_heroku_config(self):
"""Load configuration for Heroku."""
with EnvironmentVarGuard() as env:
env.set('CONFIG_FILE', 'heroku.ini')
from pgraph import backend_config as bconfig
self.assertTrue(hasattr(bconfig, 'CELERY_RESULT_BACKEND'))
self.assertTrue(hasattr(bconfig, 'BROKER_URL'))
self.assertTrue(hasattr(bconfig, 'CELERY_SEND_EVENTS'))
self.assertTrue(hasattr(bconfig,
'CELERY_EVENT_QUEUE_EXPIRES'))
self.assertTrue(hasattr(bconfig, 'BROKER_POOL_LIMIT'))
self.assertTrue(hasattr(bconfig,
'BROKER_CONNECTION_TIMEOUT'))
self.assertTrue(hasattr(bconfig, 'BROKER_HEARTBEAT'))
self.assertTrue(hasattr(bconfig, 'MEMCACHED_SERVERS'))
self.assertTrue(hasattr(bconfig, 'MEMCACHED_USERNAME'))
self.assertTrue(hasattr(bconfig, 'MEMCACHED_PASSWORD'))
self.assertTrue(hasattr(bconfig, 'CACHE_NAME'))

0 comments on commit 2f6ea28

Please sign in to comment.