예제 #1
0
    def test_create_idle_time_no_number(self):
        parser = configparser.ConfigParser()
        parser.read_string('''[section]
                           url = anurl
                           idle_time = string''')

        with pytest.raises(ConfigurationError):
            KodiIdleTime.create('name', parser['section'])
    def test_create_idle_time_no_number(self) -> None:
        parser = configparser.ConfigParser()
        parser.read_string(
            """
            [section]
            url = anurl
            idle_time = string
            """
        )

        with pytest.raises(ConfigurationError):
            KodiIdleTime.create("name", parser["section"])
    def test_create_default_url(self) -> None:
        parser = configparser.ConfigParser()
        parser.read_string("""[section]""")

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

        assert check._url.split("?")[0] == "http://localhost:8080/jsonrpc"
예제 #4
0
    def test_create(self):
        parser = configparser.ConfigParser()
        parser.read_string('''[section]
                           url = anurl
                           timeout = 12
                           idle_time = 42''')

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

        assert check._url.startswith('anurl')
        assert check._timeout == 12
        assert check._idle_time == 42
    def test_create(self) -> None:
        parser = configparser.ConfigParser()
        parser.read_string(
            """
            [section]
            url = anurl
            timeout = 12
            idle_time = 42
            """
        )

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

        assert check._url.startswith("anurl")
        assert check._timeout == 12
        assert check._idle_time == 42