Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/lookup_lmdb_kv/test_db.py

raw
1 # Copyright (c) Ansible Project
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 from __future__ import annotations
6
7 import lmdb
8
9 map_size = 1024 * 100
10 env = lmdb.open("./jp.mdb", map_size=map_size)
11 with env.begin(write=True) as txn:
12 txn.put(b"fr", b"France")
13 txn.put(b"nl", b"Netherlands")
14 txn.put(b"es", b"Spain")
15 txn.put(b"be", b"Belgium")
16 txn.put(b"lu", b"Luxembourg")