예제 #1
0
    def test__whitespace_is_tolerable(self):
        config = GeneratorConfiguration()
        lines = [
            "    ",
            "other",
        ]
        config._parse_empty_line(lines=lines)

        assert len(lines) == 1
예제 #2
0
    def test__empty_line_can_be_parsed(self):
        config = GeneratorConfiguration()
        lines = [
            "",
            "other",
        ]
        config._parse_empty_line(lines=lines)

        assert len(lines) == 1
예제 #3
0
    def test__syntax_error(self):
        config = GeneratorConfiguration()
        lines = [
            "non empty",
            "other",
        ]
        with pytest.raises(SyntaxError) as e:
            config._parse_empty_line(lines=lines)

        assert "empty" in str(e.value)

        assert len(lines) == 2