def test_str(self): with pytest.raises(NotImplementedError): str(SSDPMessage())
def test_parse(self): with pytest.raises(NotImplementedError): SSDPMessage.parse('')
def test_parse_headers(self): headers = SSDPMessage.parse_headers('Cache-Control: max-age=3600') assert headers == [('Cache-Control', 'max-age=3600')]
def test_headers_none(self): msg = SSDPMessage(headers=None) assert msg.headers == []
def test_headers_dict(self): headers = {'Cache-Control': 'max-age=3600'} msg = SSDPMessage(headers=headers) assert msg.headers == [('Cache-Control', 'max-age=3600')]
def test_headers_copy(self): headers = [('Cache-Control', 'max-age=3600')] msg = SSDPMessage(headers=headers) assert msg.headers == headers assert msg.headers is not headers
def test_parse_headers(self): headers = SSDPMessage.parse_headers("Cache-Control: max-age=3600") assert headers == [("Cache-Control", "max-age=3600")]
def test_headers_dict(self): headers = {"Cache-Control": "max-age=3600"} msg = SSDPMessage(headers=headers) assert msg.headers == [("Cache-Control", "max-age=3600")]