示例#1
0
 def test_str(self):
     with pytest.raises(NotImplementedError):
         str(SSDPMessage())
示例#2
0
 def test_parse(self):
     with pytest.raises(NotImplementedError):
         SSDPMessage.parse('')
示例#3
0
 def test_parse_headers(self):
     headers = SSDPMessage.parse_headers('Cache-Control: max-age=3600')
     assert headers == [('Cache-Control', 'max-age=3600')]
示例#4
0
 def test_headers_none(self):
     msg = SSDPMessage(headers=None)
     assert msg.headers == []
示例#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')]
示例#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
示例#7
0
文件: test_ssdp.py 项目: tibotix/ssdp
 def test_parse_headers(self):
     headers = SSDPMessage.parse_headers("Cache-Control: max-age=3600")
     assert headers == [("Cache-Control", "max-age=3600")]
示例#8
0
文件: test_ssdp.py 项目: tibotix/ssdp
 def test_headers_dict(self):
     headers = {"Cache-Control": "max-age=3600"}
     msg = SSDPMessage(headers=headers)
     assert msg.headers == [("Cache-Control", "max-age=3600")]