~daisy-pluckers/oops-repository/trunk

« back to all changes in this revision

Viewing changes to oopsrepository/tests/test_schema.py

  • Committer: Robert Collins
  • Date: 2011-02-26 19:47:58 UTC
  • Revision ID: robert@canonical.com-20110226194758-u0i9ppdqcpsjifo6
Schema creation is possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# oops-repository is Copyright 2011 Canonical Ltd.
 
2
#
 
3
# Canonical Ltd ("Canonical") distributes the oops-repository source code under
 
4
# the GNU Affero General Public License, version 3 ("AGPLv3"). See the file
 
5
# LICENSE in the source tree for more information.
 
6
 
 
7
import time
 
8
 
 
9
from fixtures import EnvironmentVariableFixture
 
10
import pycassa
 
11
from testtools import TestCase
 
12
 
 
13
from oopsrepository import schema
 
14
from oopsrepository.testing.cassandra import TemporaryKeyspace
 
15
 
 
16
 
 
17
class TestCreateSchema(TestCase):
 
18
 
 
19
    def test_creates_columnfamily(self):
 
20
        keyspace = self.useFixture(TemporaryKeyspace()).keyspace
 
21
        config = dict(keyspace=keyspace)
 
22
        schema.create(config)
 
23
        pool = pycassa.connect(keyspace)
 
24
        cf = pycassa.ColumnFamily(pool, 'OOPS')
 
25
        cf.insert('key', {"date":time.time(), "URL":'a bit boring'})