Exemple #1
0
 def test_str(self):
     with pytest.raises(NotImplementedError):
         str(SSDPMessage())
Exemple #2
0
 def test_parse(self):
     with pytest.raises(NotImplementedError):
         SSDPMessage.parse('')
Exemple #3
0
 def test_parse_headers(self):
     headers = SSDPMessage.parse_headers('Cache-Control: max-age=3600')
     assert headers == [('Cache-Control', 'max-age=3600')]
Exemple #4
0
 def test_headers_none(self):
     msg = SSDPMessage(headers=None)
     assert msg.headers == []
Exemple #5
0
 def test_headers_dict(self):
     headers = {'Cache-Control': 'max-age=3600'}
     msg = SSDPMessage(headers=headers)
     assert msg.headers == [('Cache-Control', 'max-age=3600')]
Exemple #6
0
 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
Exemple #7
0
 def test_parse_headers(self):
     headers = SSDPMessage.parse_headers("Cache-Control: max-age=3600")
     assert headers == [("Cache-Control", "max-age=3600")]
Exemple #8
0
 def test_headers_dict(self):
     headers = {"Cache-Control": "max-age=3600"}
     msg = SSDPMessage(headers=headers)
     assert msg.headers == [("Cache-Control", "max-age=3600")]