Skip to content

Commit

Permalink
- remove obsolete zcml condition, broken imports and superfluous type…
Browse files Browse the repository at this point in the history
… checks
  • Loading branch information
dataflake committed May 18, 2018
1 parent b2f7820 commit 7675d4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/Products/MailHost/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:zcml="http://namespaces.zope.org/zcml">

<include
zcml:condition="have moved_mailhost"
file="exportimport.zcml"
/>

Expand Down
26 changes: 6 additions & 20 deletions src/Products/MailHost/tests/test_exportimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
class BodyAdapterTestCase: pass
class ExportImportZCMLLayer: pass

_MAILHOST_BODY = """\
<?xml version="1.0"?>
_MAILHOST_BODY = b"""\
<?xml version="1.0" encoding="utf-8"?>
<object name="foo_mailhost" meta_type="Mail Host" smtp_host="localhost"
smtp_port="25" smtp_pwd="" smtp_queue="False" smtp_queue_directory="/tmp"
smtp_uid=""/>
"""

_MAILHOST_BODY_v2 = """\
<?xml version="1.0"?>
_MAILHOST_BODY_v2 = b"""\
<?xml version="1.0" encoding="utf-8"?>
<object name="foo_mailhost" meta_type="Mail Host" smtp_host="localhost"
smtp_port="25" smtp_pwd="" smtp_queue="True"
smtp_queue_directory="/tmp/mailqueue" smtp_uid=""/>
Expand All @@ -45,23 +45,16 @@ class MailHostXMLAdapterTests(BodyAdapterTestCase, unittest.TestCase):
layer = ExportImportZCMLLayer

def _getTargetClass(self):
from Products.GenericSetup.MailHost.exportimport \
import MailHostXMLAdapter
from Products.MailHost.exportimport import MailHostXMLAdapter

return MailHostXMLAdapter

def _verifyImport(self, obj):
self.assertEqual(type(obj.smtp_host), str)
self.assertEqual(obj.smtp_host, 'localhost')
self.assertEqual(type(obj.smtp_port), int)
self.assertEqual(obj.smtp_port, 25)
self.assertEqual(type(obj.smtp_pwd), str)
self.assertEqual(obj.smtp_pwd, '')
self.assertEqual(type(obj.smtp_uid), str)
self.assertEqual(obj.smtp_uid, '')
self.assertEqual(type(obj.smtp_queue), bool)
self.assertEqual(obj.smtp_queue, False)
self.assertEqual(type(obj.smtp_queue_directory), str)
self.assertEqual(obj.smtp_queue_directory, '/tmp')

def setUp(self):
Expand Down Expand Up @@ -93,15 +86,12 @@ class MailHostXMLAdapterTestsWithQueue(BodyAdapterTestCase, unittest.TestCase):
layer = ExportImportZCMLLayer

def _getTargetClass(self):
from Products.GenericSetup.MailHost.exportimport \
import MailHostXMLAdapter
from Products.MailHost.exportimport import MailHostXMLAdapter

return MailHostXMLAdapter

def _verifyImport(self, obj):
self.assertEqual(type(obj.smtp_queue), bool)
self.assertEqual(obj.smtp_queue, True)
self.assertEqual(type(obj.smtp_queue_directory), str)
self.assertEqual(obj.smtp_queue_directory, '/tmp/mailqueue')

def test_body_get(self):
Expand All @@ -119,13 +109,9 @@ def setUp(self):
class MailHostXMLAdapterTestsWithNoneValue(MailHostXMLAdapterTests):

def _verifyImport(self, obj):
self.assertEqual(type(obj.smtp_host), str)
self.assertEqual(obj.smtp_host, 'localhost')
self.assertEqual(type(obj.smtp_port), int)
self.assertEqual(obj.smtp_port, 25)
self.assertEqual(type(obj.smtp_pwd), str)
self.assertEqual(obj.smtp_pwd, '')
self.assertEqual(type(obj.smtp_uid), str)
self.assertEqual(obj.smtp_uid, '')

def setUp(self):
Expand Down

0 comments on commit 7675d4f

Please sign in to comment.