Move list_dict_handling to iterator_handling, add settings parser, add list helpers, add some string helpers
list_helpers: convert to list, any input, output is always a list compare to lists, check what elements from A are not in B, type safe string helpers add is_int, is_float checker add string to bool converter for true/True/false/False strings config reader with parsing and checking The simple config reader is now in the corelibs with the basic content check, convert to list for entries, convert to value for entries, etc log updates: Add Log type Enum for better log level checks and convert Add a get int for requested log level, and return default if not found Make the validate log level a static function Add tests for list helpers and new string helpers
This commit is contained in:
29
test-run/iterator_handling/list_helpers.py
Normal file
29
test-run/iterator_handling/list_helpers.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""
|
||||
test list helpers
|
||||
"""
|
||||
|
||||
from corelibs.iterator_handling.list_helpers import is_list_in_list, convert_to_list
|
||||
|
||||
|
||||
def __test_is_list_in_list_a():
|
||||
list_a = [1, "hello", 3.14, True, "world"]
|
||||
list_b = ["hello", True, 42]
|
||||
result = is_list_in_list(list_a, list_b)
|
||||
print(f"RESULT: {result}")
|
||||
|
||||
|
||||
def __convert_list():
|
||||
source = "hello"
|
||||
result = convert_to_list(source)
|
||||
print(f"IN: {source} -> {result}")
|
||||
|
||||
|
||||
def main():
|
||||
__test_is_list_in_list_a()
|
||||
__convert_list()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
# __END__
|
||||
Reference in New Issue
Block a user