| 347 | assert f.error is not f2.error |
| 348 | |
| 349 | def test_match(self): |
| 350 | f = tflow.tdnsflow(resp=True) |
| 351 | assert not flowfilter.match("~b nonexistent", f) |
| 352 | assert flowfilter.match(None, f) |
| 353 | assert flowfilter.match("~b dns.google", f) |
| 354 | assert flowfilter.match("~b 8.8.8.8", f) |
| 355 | |
| 356 | assert flowfilter.match("~bq dns.google", f) |
| 357 | assert not flowfilter.match("~bq 8.8.8.8", f) |
| 358 | |
| 359 | assert flowfilter.match("~bs dns.google", f) |
| 360 | assert flowfilter.match("~bs 8.8.4.4", f) |
| 361 | |
| 362 | assert flowfilter.match("~dns", f) |
| 363 | assert not flowfilter.match("~dns", tflow.ttcpflow()) |
| 364 | assert not flowfilter.match("~dns", tflow.tflow()) |
| 365 | |
| 366 | f = tflow.tdnsflow(err=True) |
| 367 | assert flowfilter.match("~e", f) |
| 368 | |
| 369 | with pytest.raises(ValueError): |
| 370 | flowfilter.match("~", f) |
| 371 | |
| 372 | def test_repr(self): |
| 373 | f = tflow.tdnsflow() |