Final commit, I've learned my lesson
This commit is contained in:
@@ -18,6 +18,9 @@ Python's __main__ and __init__
|
|||||||
As far as I know, __init__ is the initialization script, just like Unix and alike's /etc/init.rc script. It's required to make it so that it's a package.
|
As far as I know, __init__ is the initialization script, just like Unix and alike's /etc/init.rc script. It's required to make it so that it's a package.
|
||||||
The double underscores is for signifying that it's a global variable.
|
The double underscores is for signifying that it's a global variable.
|
||||||
|
|
||||||
|
b before string, for example b'relaxed' is a way to say that it's a binary string
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-----START DKIM DIRECTORY-----
|
-----START DKIM DIRECTORY-----
|
||||||
[__init__]
|
[__init__]
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ def validate_signature_fields(sig, mandatory_fields=[b'v', b'a', b'b', b'bh', b'
|
|||||||
if b'cv' in sig and sig[b'cv'] not in (CV_Pass, CV_Fail, CV_None):
|
if b'cv' in sig and sig[b'cv'] not in (CV_Pass, CV_Fail, CV_None):
|
||||||
raise ValidationError("cv= value is not valid (%s)" % sig[b'cv'])
|
raise ValidationError("cv= value is not valid (%s)" % sig[b'cv'])
|
||||||
|
|
||||||
|
# Somehow convert it to UTF8 before going to this?
|
||||||
# Limit domain validation to ASCII domains because too hard
|
# Limit domain validation to ASCII domains because too hard
|
||||||
try:
|
try:
|
||||||
str(sig[b'd'], 'ascii')
|
str(sig[b'd'], 'ascii')
|
||||||
@@ -311,6 +312,7 @@ def validate_signature_fields(sig, mandatory_fields=[b'v', b'a', b'b', b'bh', b'
|
|||||||
# Not an ASCII domain
|
# Not an ASCII domain
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Nasty hack to support both str and bytes... check for both the
|
# Nasty hack to support both str and bytes... check for both the
|
||||||
# character and integer values.
|
# character and integer values.
|
||||||
if not arc and b'i' in sig and (
|
if not arc and b'i' in sig and (
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import doctest
|
import doctest
|
||||||
import dkim
|
import dkim
|
||||||
from tests import test_suite
|
from dkim.tests import test_suite
|
||||||
|
|
||||||
doctest.testmod(dkim)
|
doctest.testmod(dkim)
|
||||||
unittest.TextTestRunner().run(test_suite())
|
unittest.TextTestRunner().run(test_suite())
|
||||||
|
|||||||
Reference in New Issue
Block a user