Did I find the right examples for you? yes no

All Samples(26)  |  Call(20)  |  Derive(0)  |  Import(6)

        def gen_uuid():
    return str(uuid.uuid4()).replace('-', '')
        


src/s/i/simplestore-HEAD/simplestore/tests/test_sharding.py   simplestore(Download)
 
from simplestore.tests import config
from simplestore.tests import gen_uuid, User, Entry
 
class ShardTestCase(unittest.TestCase):
    def test_put_get(self):
        user = User(id=gen_uuid(), firstname='David', lastname='Reynolds')
        user.username = 'david'
        self.datastore.put(user)
 
        entries = []
        for i in xrange(10):
            entry = Entry(id=gen_uuid(),
                          user_id=user['id'],
                          title='%s' % i,

src/s/i/simplestore-HEAD/simplestore/tests/test_indexing.py   simplestore(Download)
 
from simplestore.index import Index
from simplestore.tests import gen_uuid, User, Entry, DataStoreTestCase
 
class IndexTestCase(DataStoreTestCase):
    def test_put_get(self):
        user = User(id=gen_uuid(), firstname='David', lastname='Reynolds')
        user.username = 'david'
 
        self.datastore.put(user)
    def test_put_get_list(self):
        user = User(id=gen_uuid(), firstname='David', lastname='Reynolds')
        user.username = 'david'
        self.datastore.put(user)
 
        entry1 = Entry(id=gen_uuid(),
                       content='Hello, World')
 
        entry2 = Entry(id=gen_uuid(),
                       user_id=user.id,
                       title='Bar',

src/s/i/simplestore-HEAD/simplestore/tests/test_datastore.py   simplestore(Download)
 
from simplestore.tests import config
from simplestore.tests import gen_uuid, Person, DataStoreTestCase
 
class TestBlankEntitiesTable(DataStoreTestCase):
    def test_put_get(self):
        p = Person(id=gen_uuid(), firstname='David', lastname='Reynolds')
        self.datastore.put(p)
 
        entity = self.datastore.get(p.id)
    def test_update(self):
        p = Person(id=gen_uuid(), firstname='David', lastname='Reynolds')
        self.datastore.put(p)
 
        entity = self.datastore.get(p.id)
    def test_put_get_list(self):
        persons = [Person(id=gen_uuid(), firstname='David', lastname='Reynolds'),
                   Person(id=gen_uuid(), firstname='Foo', lastname='Bar')]
        self.datastore.put_list(persons)
 

src/s/i/simplestore-0.3.1/simplestore/tests/test_sharding.py   simplestore(Download)
 
from simplestore.tests import config
from simplestore.tests import gen_uuid, User, Entry
 
class ShardTestCase(unittest.TestCase):
    def test_put_get(self):
        user = User(id=gen_uuid(), firstname='David', lastname='Reynolds')
        user.username = 'david'
        self.datastore.put(user)
 
        entries = []
        for i in xrange(10):
            entry = Entry(id=gen_uuid(),
                          user_id=user['id'],
                          title='%s' % i,

src/s/i/simplestore-0.3.1/simplestore/tests/test_indexing.py   simplestore(Download)
 
from simplestore.index import Index
from simplestore.tests import gen_uuid, User, Entry, DataStoreTestCase
 
class IndexTestCase(DataStoreTestCase):
    def test_put_get(self):
        user = User(id=gen_uuid(), firstname='David', lastname='Reynolds')
        user.username = 'david'
 
        self.datastore.put(user)
    def test_put_get_list(self):
        user = User(id=gen_uuid(), firstname='David', lastname='Reynolds')
        user.username = 'david'
        self.datastore.put(user)
 
        entry1 = Entry(id=gen_uuid(),
                       content='Hello, World')
 
        entry2 = Entry(id=gen_uuid(),
                       user_id=user.id,
                       title='Bar',

src/s/i/simplestore-0.3.1/simplestore/tests/test_datastore.py   simplestore(Download)
 
from simplestore.tests import config
from simplestore.tests import gen_uuid, Person, DataStoreTestCase
 
class TestBlankEntitiesTable(DataStoreTestCase):
    def test_put_get(self):
        p = Person(id=gen_uuid(), firstname='David', lastname='Reynolds')
        self.datastore.put(p)
 
        entity = self.datastore.get(p.id)
    def test_update(self):
        p = Person(id=gen_uuid(), firstname='David', lastname='Reynolds')
        self.datastore.put(p)
 
        entity = self.datastore.get(p.id)
    def test_put_get_list(self):
        persons = [Person(id=gen_uuid(), firstname='David', lastname='Reynolds'),
                   Person(id=gen_uuid(), firstname='Foo', lastname='Bar')]
        self.datastore.put_list(persons)