File: test_program_config.py

package info (click to toggle)
python-ruyaml 0.92.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,732 kB
  • sloc: python: 19,399; makefile: 200; sh: 13
file content (65 lines) | stat: -rw-r--r-- 1,930 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# coding: utf-8

import pytest  # type: ignore  # NOQA

# import ruyaml
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
        """
        )