Exemple #1
0
def test_sharded_remove_works_with_embedded_documents():
    t = TestArray('test_sharded_remove_embedded')
    if not enable_sharding(TestArray._page.config_collection, {'_id': 1}):
        raise SkipTest
    with DBTest:
        for word in "The quick brown fox jumps over the lazy dog.".split():
            t.append({'word': word})
        eq_(t.length(), 9)
        eq_(t.pages(), 4)
        eq_(t[3], [])
        t.remove({'word': 'lazy'})
        eq_(t.length(), 8)
        eq_(t[2], [{'word': 'the'}, {'word': 'dog.'}])
        t.remove({'word': 'fox'})
        eq_(t.length(), 7)
        eq_(t[1], [{'word': 'jumps'}, {'word': 'over'}])
Exemple #2
0
def test_sharded_remove_works_with_embedded_documents():
    t = TestArray('test_sharded_remove_embedded')
    if not enable_sharding(TestArray._page.config_collection, {'_id': 1}):
        raise SkipTest
    with DBTest:
        for word in "The quick brown fox jumps over the lazy dog.".split():
            t.append({'word': word})
        eq_(t.length(), 9)
        eq_(t.pages(), 4)
        eq_(t[3], [])
        t.remove({'word': 'lazy'})
        eq_(t.length(), 8)
        eq_(t[2], [{'word': 'the'}, {'word': 'dog.'}])
        t.remove({'word': 'fox'})
        eq_(t.length(), 7)
        eq_(t[1], [{'word': 'jumps'}, {'word': 'over'}])
Exemple #3
0
def test_sharded_remove_works():
    t = TestArray('test_sharded_remove')
    if not enable_sharding(TestArray._page.config_collection, {'_id': 1}):
        raise SkipTest
    with DBTest:
        for word in "The quick brown fox jumps over the lazy dog.".split():
            t.append(word)
        eq_(t.length(), 9)
        eq_(t.pages(), 4)
        eq_(t[3], [])
        t.remove('lazy')
        eq_(t.length(), 8)
        eq_(t[2], ['the', 'dog.'])
        t.remove('fox')
        eq_(t.length(), 7)
        eq_(t[1], ['jumps', 'over'])
Exemple #4
0
def test_sharded_remove_works():
    t = TestArray('test_sharded_remove')
    if not enable_sharding(TestArray._page.config_collection, {'_id': 1}):
        raise SkipTest
    with DBTest:
        for word in "The quick brown fox jumps over the lazy dog.".split():
            t.append(word)
        eq_(t.length(), 9)
        eq_(t.pages(), 4)
        eq_(t[3], [])
        t.remove('lazy')
        eq_(t.length(), 8)
        eq_(t[2], ['the', 'dog.'])
        t.remove('fox')
        eq_(t.length(), 7)
        eq_(t[1], ['jumps', 'over'])