-
-
Notifications
You must be signed in to change notification settings - Fork 944
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganizes kombu.utils.__init__ package
- Loading branch information
Showing
59 changed files
with
901 additions
and
810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,6 @@ | |
'kombu.async.aws.ext', | ||
'kombu.async.aws.sqs.ext', | ||
'kombu.transport.qpid_patches', | ||
'kombu.utils', | ||
], | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
========================================================== | ||
Custom Collections - ``kombu.utils.collections`` | ||
========================================================== | ||
|
||
.. contents:: | ||
:local: | ||
.. currentmodule:: kombu.utils.collections | ||
|
||
.. automodule:: kombu.utils.collections | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
========================================================== | ||
Python Compatibility - ``kombu.utils.compat`` | ||
========================================================== | ||
|
||
.. contents:: | ||
:local: | ||
.. currentmodule:: kombu.utils.compat | ||
|
||
.. automodule:: kombu.utils.compat | ||
:members: | ||
:undoc-members: |
6 changes: 3 additions & 3 deletions
6
docs/reference/kombu.utils.rst → docs/reference/kombu.utils.div.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
========================================================== | ||
Utilities - ``kombu.utils`` | ||
Div Utilities - ``kombu.utils.div`` | ||
========================================================== | ||
|
||
.. contents:: | ||
:local: | ||
.. currentmodule:: kombu.utils | ||
.. currentmodule:: kombu.utils.div | ||
|
||
.. automodule:: kombu.utils | ||
.. automodule:: kombu.utils.div | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
========================================================== | ||
Module Importing Utilities - ``kombu.utils.imports`` | ||
========================================================== | ||
|
||
.. contents:: | ||
:local: | ||
.. currentmodule:: kombu.utils.imports | ||
|
||
.. automodule:: kombu.utils.imports | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
========================================================== | ||
Object/Property Utilities - ``kombu.utils.objects`` | ||
========================================================== | ||
|
||
.. contents:: | ||
:local: | ||
.. currentmodule:: kombu.utils.objects | ||
|
||
.. automodule:: kombu.utils.objects | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
========================================================== | ||
UUID Utilities - ``kombu.utils.uuid`` | ||
========================================================== | ||
|
||
.. contents:: | ||
:local: | ||
.. currentmodule:: kombu.utils.uuid | ||
|
||
.. automodule:: kombu.utils.uuid | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from kombu.utils.compat import entrypoints, maybe_fileno | ||
|
||
from kombu.tests.case import Case, Mock, mock, patch | ||
|
||
|
||
class test_entrypoints(Case): | ||
|
||
@mock.mask_modules('pkg_resources') | ||
def test_without_pkg_resources(self): | ||
self.assertListEqual(list(entrypoints('kombu.test')), []) | ||
|
||
@mock.module_exists('pkg_resources') | ||
def test_with_pkg_resources(self): | ||
with patch('pkg_resources.iter_entry_points', create=True) as iterep: | ||
eps = iterep.return_value = [Mock(), Mock()] | ||
|
||
self.assertTrue(list(entrypoints('kombu.test'))) | ||
iterep.assert_called_with('kombu.test') | ||
eps[0].load.assert_called_with() | ||
eps[1].load.assert_called_with() | ||
|
||
|
||
class test_maybe_fileno(Case): | ||
|
||
def test_maybe_fileno(self): | ||
self.assertEqual(maybe_fileno(3), 3) | ||
f = Mock(name='file') | ||
self.assertIs(maybe_fileno(f), f.fileno()) | ||
f.fileno.side_effect = ValueError() | ||
self.assertIsNone(maybe_fileno(f)) |
Oops, something went wrong.