Ejemplo n.º 1
0
    def test_create_timeout_no_number(self):
        parser = configparser.ConfigParser()
        parser.read_string('''[section]
                           host = host
                           port = 10
                           timeout = string''')

        with pytest.raises(ConfigurationError):
            Mpd.create('name', parser['section'])
    def test_create_timeout_no_number(self) -> None:
        parser = configparser.ConfigParser()
        parser.read_string(
            """
            [section]
            host = host
            port = 10
            timeout = string
            """
        )

        with pytest.raises(ConfigurationError):
            Mpd.create("name", parser["section"])
Ejemplo n.º 3
0
    def test_create(self):
        parser = configparser.ConfigParser()
        parser.read_string('''[section]
                           host = host
                           port = 1234
                           timeout = 12''')

        check = Mpd.create('name', parser['section'])

        assert check._host == 'host'
        assert check._port == 1234
        assert check._timeout == 12
    def test_create(self) -> None:
        parser = configparser.ConfigParser()
        parser.read_string(
            """
            [section]
            host = host
            port = 1234
            timeout = 12
            """
        )

        check = Mpd.create("name", parser["section"])

        assert check._host == "host"
        assert check._port == 1234
        assert check._timeout == 12