Skip to content

Commit

Permalink
internetstandards#1474 make tests pass, fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
uwekamper committed Sep 6, 2024
1 parent 1ea98e0 commit c108b4d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions checks/test/test_dmarc_parser.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Copyright: 2024, ECP, NLnet Labs and the Internet.nl contributors
# SPDX-License-Identifier: Apache-2.0
import pytest
from pyparsing import ParseException
from checks.task.dmarc_parser import _check_dmark_uri, parse
from pyparsing import ParseException, ParseResults

from checks.tasks.dmarc_parser import _check_dmarc_uri, parse


def test__check_dmarc_uri():
"""
Check if None is returned on valid URI
"""
assert _check_dmarc_uri(['mailto:[email protected]']) == None
assert _check_dmarc_uri(['mailto:[email protected]']) is None


def test__check_dmarc_uri_detect_missing_uri_scheme():
Expand All @@ -24,4 +25,6 @@ def test__check_dmarc_uri_detect_missing_uri_scheme():
def test_parse():
sample_record = 'v=DMARC1; p=none; rua=mailto:[email protected]'
result = parse(sample_record)
assert result == ['v=DMARC1', ['p=none', 'rua=mailto:[email protected]']]
assert result.version == 'v=DMARC1'
assert result.directives.request == 'p=none'
assert result.directives.auri == 'rua=mailto:[email protected]'

0 comments on commit c108b4d

Please sign in to comment.