Example #1
0
def test_map_simple(token_restore):
    with gcs_maker() as gcs:
        d = gcs.get_mapper(root)
        assert not d

        assert list(d) == list(d.keys()) == []
        assert list(d.values()) == []
        assert list(d.items()) == []
Example #2
0
def test_map_simple(token_restore):
    with gcs_maker() as gcs:
        d = GCSMap(root, gcs)
        assert not d

        assert list(d) == list(d.keys()) == []
        assert list(d.values()) == []
        assert list(d.items()) == []
        d = GCSMap(root, gcs, check=True)
Example #3
0
def test_map_with_data(token_restore):
    with gcs_maker() as gcs:
        d = gcs.get_mapper(root)
        d['x'] = b'123'
        assert list(d) == list(d.keys()) == ['x']
        assert list(d.values()) == [b'123']
        assert list(d.items()) == [('x', b'123')]
        assert d['x'] == b'123'
        assert bool(d)

        assert gcs.find(root) == [TEST_BUCKET+'/mapping/x']
        d['x'] = b'000'
        assert d['x'] == b'000'

        d['y'] = b'456'
        assert d['y'] == b'456'
        assert set(d) == {'x', 'y'}

        d.clear()
        assert list(d) == []