diff --git a/.travis.yml b/.travis.yml index f992224..8bac12e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,9 @@ python: # command to install dependencies install: - python setup.py develop - - pip install nose coverage coveralls + - pip install pytest coverage coveralls script: - - coverage run `which nosetests` - - coverage report -m + - ./runtests.sh after_success: - coveralls notifications: diff --git a/CHANGES.rst b/CHANGES.rst index 796d2e4..f71cc62 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,10 @@ +0.3.5 +===== + +* Fixed wildcard subdomain matching +* New service provider +* Updated PyPI classifiers + 0.3.4 ===== diff --git a/mxsniff/__init__.py b/mxsniff/__init__.py index 855d3ae..3a43d85 100644 --- a/mxsniff/__init__.py +++ b/mxsniff/__init__.py @@ -47,6 +47,10 @@ class WildcardDomainDict(object): 'example-wildcard' >>> d['sub.wildcard.example.com'] 'example-subdotted' + >>> d['example.wildcard.com'] + Traceback (most recent call last): + ... + KeyError: 'example.wildcard.com' """ def __init__(self, *args, **kwargs): self.tree = dict(*args, **kwargs) @@ -79,6 +83,8 @@ def __getitem__(self, key): tree = tree[item] elif '*' in tree: tree = tree['*'] + else: + raise KeyError(key) if _value in tree: return tree[_value] else: diff --git a/mxsniff/_version.py b/mxsniff/_version.py index 1dbbba0..d1d5b77 100644 --- a/mxsniff/_version.py +++ b/mxsniff/_version.py @@ -1,4 +1,4 @@ __all__ = ['__version__', '__version_info__'] -__version__ = '0.3.4' +__version__ = '0.3.5' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')]) diff --git a/mxsniff/providers.py b/mxsniff/providers.py index 5ae78a5..62c7824 100644 --- a/mxsniff/providers.py +++ b/mxsniff/providers.py @@ -66,6 +66,11 @@ 'carrierzone': {'mx': [ '*.carrierzone.com', ]}, + 'cogent': {'mx': [ + '*.mail.cogentco.com', + ], + 'title': "Cogent Communications" + }, 'cologlobal': {'mx': [ '*.cologlobal.com', ]}, diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..df3eb51 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --doctest-modules diff --git a/setup.py b/setup.py index 598ae97..adfcd24 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ if mo: version = mo.group(1) else: - raise RuntimeError("Unable to find version string in mxsniff/_version.py.") + raise RuntimeError("Unable to find version string in mxsniff/_version.py") setup(name='mxsniff', @@ -29,11 +29,18 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Intended Audience :: Developers', - 'Development Status :: 3 - Alpha', + 'Intended Audience :: System Administrators', + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Topic :: Communications :: Email', + 'Topic :: Internet', 'Topic :: Software Development :: Libraries', + 'Topic :: Utilities', ], author='Kiran Jonnalagadda', author_email='jace@pobox.com',