~daisy-pluckers/oops-repository/trunk

« back to all changes in this revision

Viewing changes to oopsrepository/tests/test_matchers.py

  • Committer: Evan Dandrea
  • Date: 2013-03-02 21:52:48 UTC
  • mto: This revision was merged to the branch mainline in revision 59.
  • Revision ID: evan.dandrea@canonical.com-20130302215248-93tai9p3npapygsk
Remove hardcoded localhost references in the test suite. Default to localhost if a host is not set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
# LICENSE in the source tree for more information.
6
6
 
7
7
from testtools import TestCase
 
8
import os
8
9
 
9
10
from oopsrepository import schema
 
11
from oopsrepository import config
10
12
from oopsrepository.testing.cassandra import TemporaryKeyspace
11
13
from oopsrepository.testing.matchers import HasOOPSSchema
12
14
 
16
18
    def test_creates_columnfamily(self):
17
19
        keyspace = self.useFixture(TemporaryKeyspace()).keyspace
18
20
        self.assertNotEqual(None, HasOOPSSchema().match(keyspace))
19
 
        config = dict(keyspace=keyspace, host=['localhost:9160'])
20
 
        schema.create(config)
 
21
        os.environ['OOPS_KEYSPACE'] = keyspace
 
22
        schema.create(config.get_config())
21
23
        self.assertThat(keyspace, HasOOPSSchema())