Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Commit

Permalink
Update import logic to better work with python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
albertyw committed Jan 26, 2020
1 parent 7b01f2f commit 88af480
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions mailgun2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from __future__ import absolute_import

__title__ = 'mailgun2'
__version__ = '1.1.0'
__author__ = 'Albert Wang'
__license__ = 'Apache 2.0'

try:
from .mailgun import Mailgun # noqa: F401
except ImportError:
pass
from .mailgun import Mailgun # noqa: F401
File renamed without changes.
7 changes: 4 additions & 3 deletions tests/mailgun.py → mailgun2/tests/mailgun.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import absolute_import
import os
import unittest

from mock import patch

import mailgun2
from .. import Mailgun


class MailgunTestBase(unittest.TestCase):
Expand All @@ -12,7 +13,7 @@ def setUp(self):
self.public_key = 'test_public_key'
self.private_key = 'test_private_key'
self.domain = 'test.domain'
self.mailgun = mailgun2.Mailgun(
self.mailgun = Mailgun(
self.domain,
self.public_key,
self.private_key,
Expand Down Expand Up @@ -94,7 +95,7 @@ def test_headers(self):

def test_inlines_attachments(self):
current_path = os.path.abspath(os.path.dirname(__file__))
license_file = current_path + '/../LICENSE'
license_file = current_path + '/../../LICENSE'
self.mailgun.send_message(
'from@example.com',
'to@example.com',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'requests>=2.6,<3.0',
],
license='Apache',
test_suite="tests",
test_suite="mailgun2.tests",
# testing requires flake8 and coverage but they're listed separately
# because they need to wrap setup.py
extras_require={
Expand Down

0 comments on commit 88af480

Please sign in to comment.