Beispiel #1
0
 def test_unknownkey_raises(self):
     pd = ProxyData(version=1)
     pd.protocol = PROTO.UNSPEC
     assert pd.valid
     assert pd
     expectre = r"notfound:strange_key"
     with pytest.raises(KeyError, match=expectre):
         pd.same_attribs(_raises=True, strange_key="Unrecognized")
Beispiel #2
0
 def test_mismatch_raises(self):
     pd = ProxyData(version=1)
     pd.protocol = PROTO.UNSPEC
     assert pd.valid
     assert pd
     expectre = r"mismatch:protocol actual=.* expect=.*"
     with pytest.raises(ValueError, match=expectre):
         pd.same_attribs(_raises=True, protocol=PROTO.STREAM)
Beispiel #3
0
 def test_unknownkey(self):
     pd = ProxyData(version=1)
     pd.protocol = PROTO.UNSPEC
     assert pd.valid
     assert pd
     assert not pd.same_attribs(strange_key="Unrecognized")
Beispiel #4
0
 def test_unsetkey(self):
     pd = ProxyData(version=1)
     pd.protocol = PROTO.UNSPEC
     assert pd.valid
     assert pd
     assert not pd.same_attribs(src_addr="Missing")
Beispiel #5
0
 def test_mismatch(self):
     pd = ProxyData(version=1)
     pd.protocol = PROTO.UNSPEC
     assert pd.valid
     assert pd
     assert not pd.same_attribs(protocol=PROTO.STREAM)