コード例 #1
0
ファイル: test_Store.py プロジェクト: lowks/data_store
def test_del_record_removes_a_record():
    """Tests that del_record will remove a record from the Store."""
    store = Store()

    store.add_record({"this": "that", "that": "foo"})
    assert len(store) == 1
    store.del_record({"this": "that", "that": "foo"})
    assert len(store) == 0
コード例 #2
0
ファイル: test_Store.py プロジェクト: iLoveTux/data_store
def test_del_record_removes_a_record():
    """Tests that del_record will remove a record from the Store."""
    store = Store()

    store.add_record({"this": "that", "that": "foo"})
    assert len(store) == 1
    store.del_record({"this": "that", "that": "foo"})
    assert len(store) == 0
コード例 #3
0
ファイル: test_Store.py プロジェクト: iLoveTux/data_store
 def run(self):
     for x in xrange(10):
         sx = str(x)
         record = store.add_record({"name": sx, "email": sx})
         store.persist("tmp.db")
         store.del_record(record)
         store.persist("tmp.db")
コード例 #4
0
ファイル: test_Store.py プロジェクト: lowks/data_store
 def run(self):
     for x in xrange(10):
         sx = str(x)
         record = store.add_record({"name": sx, "email": sx})
         store.persist("tmp.db")
         store.del_record(record)
         store.persist("tmp.db")
コード例 #5
0
ファイル: test_Store.py プロジェクト: iLoveTux/data_store
 def add_delete():
     for x in xrange(10):
         sx = str(x)
         record = store.add_record({
             "name": sx,
             "email": "{}@example.com".format(sx)
         })
         store.del_record(record)
コード例 #6
0
ファイル: test_Store.py プロジェクト: iLoveTux/data_store
def test_each_record_gets_uuid():
    """tests that each record gets a unique  uuid in the '_id'"""
    store = data.store.Store()
    store.add_record({"this": "that"})
    rec = store.find_one({"this": "that"})
    assert "_id" in rec
コード例 #7
0
ファイル: test_Store.py プロジェクト: iLoveTux/data_store
def test_add_record_adds_a_record():
    """Tests that the Store's add_record method adds a record to Store."""
    store = Store()

    store.add_record({"this": "that", "that": "foo"})
    assert len(store) == 1
コード例 #8
0
ファイル: test_Store.py プロジェクト: lowks/data_store
 def add_delete():
     for x in xrange(10):
         sx = str(x)
         record = store.add_record({"name": sx, "email": "{}@example.com".format(sx)})
         store.del_record(record)
コード例 #9
0
ファイル: test_Store.py プロジェクト: lowks/data_store
def test_each_record_gets_uuid():
    """tests that each record gets a unique  uuid in the '_id'"""
    store = data.store.Store()
    store.add_record({"this": "that"})
    rec = store.find_one({"this": "that"})
    assert "_id" in rec
コード例 #10
0
ファイル: test_Store.py プロジェクト: lowks/data_store
def test_add_record_adds_a_record():
    """Tests that the Store's add_record method adds a record to Store."""
    store = Store()

    store.add_record({"this": "that", "that": "foo"})
    assert len(store) == 1