~doanac/ubuntu-ci-services-itself/lander-integration-bugs

« back to all changes in this revision

Viewing changes to cli/tests/__init__.py

  • Committer: Chris Johnston
  • Author(s): Ursula Junque (Ursinha)
  • Date: 2014-01-29 18:56:23 UTC
  • mfrom: (172.1.1 mock_load_config)
  • Revision ID: chris_johnston-20140129185623-i4omzwx888owqk59
[r=Chris Johnston] Mocks load_config to avoid test issues caused by changes in the config files.  from Ursula Junque

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import unittest
18
18
import sys
 
19
 
19
20
from cStringIO import StringIO
20
21
from contextlib import contextmanager
21
22
 
40
41
    sys.stdout = out
41
42
 
42
43
 
 
44
def mock_load_config():
 
45
    # mock up settings needed by tests that normally come from config
 
46
    utils.AUTH_CONFIG = {"ci_url": "foo",
 
47
                         "auth_url": "test",
 
48
                         "auth_user": "test",
 
49
                         "auth_password": "test",
 
50
                         "auth_tenant": "test",
 
51
                         }
 
52
    utils.CI_URL = utils.AUTH_CONFIG['ci_url']
 
53
 
 
54
 
43
55
class CLITestCase(unittest.TestCase):
44
 
    '''provides the necessary setup for doing CLI testing'''
 
56
    '''Provides the necessary setup for doing CLI testing.'''
45
57
    def setUp(self):
46
58
        super(CLITestCase, self).setUp()
47
 
 
48
 
        # mock up settings needed by tests that normally come from config
49
 
        utils.CI_URL = 'foo'
50
 
        utils.AUTH_CONFIG = {}