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