How to export dictionary as a .property file in python

How can a dictionary in python be exported to .properties file type in python? What I have: dict = {"key1":"sentence1", "key2":"sentence2"} The object dict should be saved as .properties file in python, the output should look like this: key1=sentence1 key2=sentence2 >Solution : You could use python built-in library configparser import configparser dict = {"key1":"sentence1", "key2":"sentence2"}… Read More How to export dictionary as a .property file in python

How to populate yml property file in JUnit 5 test without build spring context

Let’s say that I have a service that took a property file from the application.yml file: orders: batch-size: 2 and read by @Value annotation: @Value("${orders.batch-size}") private String ordersBatchSize; to conduct data partitioning. I am writing the JUnit tests and would like to get the above property from the application.yml file which is in the resources.… Read More How to populate yml property file in JUnit 5 test without build spring context