summaryrefslogtreecommitdiffstats
path: root/_test/test_program_config.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 00:33:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 00:33:55 +0000
commitcbbc936ed9811bdb5dd480bc2c5e10c3062532be (patch)
treeec1783c0aaa2ee6eaa6d6362f2bed4392943de8e /_test/test_program_config.py
parentReleasing progress-linux version 0.18.5-1~exp1~progress7.99u1. (diff)
downloadruamel.yaml-cbbc936ed9811bdb5dd480bc2c5e10c3062532be.tar.xz
ruamel.yaml-cbbc936ed9811bdb5dd480bc2c5e10c3062532be.zip
Merging upstream version 0.18.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '_test/test_program_config.py')
-rw-r--r--_test/test_program_config.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/_test/test_program_config.py b/_test/test_program_config.py
new file mode 100644
index 0000000..cda40d3
--- /dev/null
+++ b/_test/test_program_config.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+import pytest # type: ignore # NOQA
+
+# import ruamel.yaml
+from roundtrip import round_trip # type: ignore
+
+
+class TestProgramConfig:
+ def test_application_arguments(self) -> None:
+ # application configur
+ round_trip("""
+ args:
+ username: anthon
+ passwd: secret
+ fullname: Anthon van der Neut
+ tmux:
+ session-name: test
+ loop:
+ wait: 10
+ """)
+
+ def test_single(self) -> None:
+ # application configuration
+ round_trip("""
+ # default arguments for the program
+ args: # needed to prevent comment wrapping
+ # this should be your username
+ username: anthon
+ passwd: secret # this is plaintext don't reuse \
+# important/system passwords
+ fullname: Anthon van der Neut
+ tmux:
+ session-name: test # make sure this doesn't clash with
+ # other sessions
+ loop: # looping related defaults
+ # experiment with the following
+ wait: 10
+ # no more argument info to pass
+ """)
+
+ def test_multi(self) -> None:
+ # application configuration
+ round_trip("""
+ # default arguments for the program
+ args: # needed to prevent comment wrapping
+ # this should be your username
+ username: anthon
+ passwd: secret # this is plaintext don't reuse
+ # important/system passwords
+ fullname: Anthon van der Neut
+ tmux:
+ session-name: test # make sure this doesn't clash with
+ # other sessions
+ loop: # looping related defaults
+ # experiment with the following
+ wait: 10
+ # no more argument info to pass
+ """)