~daisy-pluckers/oops-repository/trunk

« back to all changes in this revision

Viewing changes to oopsrepository/testing/matchers.py

  • Committer: Robert Collins
  • Date: 2011-04-03 11:14:12 UTC
  • Revision ID: robert@canonical.com-20110403111412-6s3jf6w2v38jsnjs
Add an insert method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
"""Various oopsrepository specific matchers."""
8
8
 
 
9
import json
9
10
import time
 
11
import uuid
10
12
 
11
13
import pycassa
12
14
from pycassa.cassandra.Cassandra import NotFoundException
23
25
        pool = pycassa.connect(keyspace)
24
26
        try:
25
27
            cf = pycassa.ColumnFamily(pool, 'OOPS')
26
 
            cf.insert('key', {"date":time.time(), "URL":'a bit boring'})
 
28
            cf.insert('key',
 
29
                {"date":json.dumps(time.time()), "URL":'a bit boring'})
 
30
            cf = pycassa.ColumnFamily(pool, 'DayOOPS')
 
31
            cf.insert('20100212', {uuid.uuid1(): 'key'})
27
32
        except NotFoundException as e:
28
33
            return Mismatch(e.why)