Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions marine/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .marine import Marine
from .marine_pool import MarinePool
from .exceptions import *


# TODO: create simple functions for using Marine instead of exposing the class
9 changes: 6 additions & 3 deletions tests/marine/test_marine.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


from marine import encap_consts
from marine import BadBPFException, BadDisplayFilterException, InvalidFieldException

# TODO: Add a test for FTP.

Expand Down Expand Up @@ -483,7 +484,7 @@ def test_packet_doesnt_pass_filter_because_of_display_filter(
def test_illegal_bpf_in_filter_and_parse(
marine_or_marine_pool: Union[Marine, MarinePool], tcp_packet: bytes
):
with pytest.raises(ValueError, match="Failed compiling the BPF"):
with pytest.raises(BadBPFException, match="Failed compiling the BPF"):
filter_and_parse(
marine_or_marine_pool,
tcp_packet,
Expand All @@ -495,7 +496,9 @@ def test_illegal_bpf_in_filter_and_parse(
def test_illegal_display_filter_in_filter_and_parse(
marine_or_marine_pool: Union[Marine, MarinePool], tcp_packet: bytes
):
with pytest.raises(ValueError, match="neither a field nor a protocol name"):
with pytest.raises(
BadDisplayFilterException, match="neither a field nor a protocol name"
):
filter_and_parse(
marine_or_marine_pool,
tcp_packet,
Expand All @@ -507,7 +510,7 @@ def test_illegal_display_filter_in_filter_and_parse(
def test_illegal_fields_in_filter_and_parse(
marine_or_marine_pool: Union[Marine, MarinePool], tcp_packet: bytes
):
with pytest.raises(ValueError) as excinfo:
with pytest.raises(InvalidFieldException) as excinfo:
filter_and_parse(
marine_or_marine_pool,
tcp_packet,
Expand Down