def test_manage_cfg_store_any_item(): algo = sha512() algo.update(("lorem ipsum\n" * 10).encode("latin1")) cfg = dict(simple=1, txt="lorem ipsum\n" * 4, hash=algo.digest().decode("latin1")) write_pkg_config(cfg, tmp_dir) new_cfg = get_pkg_config(tmp_dir) assert new_cfg == cfg algo = sha512() algo.update(("lorem ipsum\n" * 10).encode("latin1")) assert algo.digest() == new_cfg['hash'].encode("latin1")
def test_manage_pkg_config(): cfg = {'toto': 1} write_pkg_config(cfg, tmp_dir) new_cfg = get_pkg_config(tmp_dir) assert new_cfg == cfg