Exemplo n.º 1
0
    def with_an_empty_section(config):
        write(config, """
        [Foobar]
        """)

        expect(parse_config(str(config))) == {
            'Foobar': {
                'versions': '',
                'patterns': [''],
            },
        }
Exemplo n.º 2
0
    def with_multiple_versions(config):
        write(
            config, """
        [Foobar]

        version = 1
        versions = 2 | 3 |     4
        """)

        expect(parse_config(str(config))) == {
            'Foobar': {
                'versions': '2 | 3 |     4',
                'patterns': ['2', '3', '4'],
            },
        }
Exemplo n.º 3
0
    def with_a_filled_section(config):
        write(
            config, """
        [Foobar]

        cli = foobar
        version = v1.2.3
        """)

        expect(parse_config(str(config))) == {
            'Foobar': {
                'cli': 'foobar',
                'versions': 'v1.2.3',
                'patterns': ['v1.2.3'],
            },
        }
Exemplo n.º 4
0
    def with_no_content(config):
        config.write("")

        expect(parse_config(str(config))) == {}