import sys import pathlib test_file = pathlib.Path(__file__).absolute() test_dir = test_file.parent project_dir = test_dir.parent source_dir = project_dir / "src" sys.path.append(str(source_dir)) import CxPini as pini first = pini.key() first.name = "first" first.value = 10 second = pini.key() second.name = "other" second.value = "This is other key" last = pini.key() last.name = "last" last.value = 20 last.comment = "And with comment" sample = pini.section() sample.add_comment("This is very basic library. ") sample.add_comment("It could be used as very very very nice. ") sample.add_comment("It is possible to split this very long comments auto.") sample.add_comment("I think it is very nice. You have not to do it Yourself.") sample.name = "Section" sample.add(first) sample.add(second) sample.add(last) print(sample) if sample.get("first").value != 10: print("Can not get first.") if not sample.exists("other"): print("Second can not be found.") if sample.get("last").value != 20: print("Last return bad content.") if sample.exists("jiojoijio"): print("Key which not exists is returned.") sample.drop(last) sample.drop("other") print(sample)