Exemplo n.º 1
0
    def test_create_timeout_no_number(self):
        parser = configparser.ConfigParser()
        parser.read_string('''[section]
                           url = anurl
                           timeout = string''')

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

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

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

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

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

        assert check._url.startswith('anurl')
        assert check._timeout == 12
Exemplo n.º 5
0
    def test_create_suspend_while_paused(self):
        parser = configparser.ConfigParser()
        parser.read_string('''[section]
                           url = anurl
                           suspend_while_paused = True''')

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

        assert check._url.startswith('anurl')
        assert check._suspend_while_paused
    def test_create_suspend_while_paused(self) -> None:
        parser = configparser.ConfigParser()
        parser.read_string(
            """
            [section]
            url = anurl
            suspend_while_paused = True
            """
        )

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

        assert check._url.startswith("anurl")
        assert check._suspend_while_paused