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"
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
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