Beispiel #1
0
    def test_with_pkg_resources(self):
        with patch('pkg_resources.iter_entry_points', create=True) as iterep:
            eps = iterep.return_value = [Mock(), Mock()]

            assert list(entrypoints('kombu.test'))
            iterep.assert_called_with('kombu.test')
            eps[0].load.assert_called_with()
            eps[1].load.assert_called_with()
Beispiel #2
0
def test_entrypoints():
    with patch('kombu.utils.compat.importlib_metadata.entry_points',
               create=True) as iterep:
        eps = [Mock(), Mock()]
        iterep.return_value = {'kombu.test': eps}

        assert list(entrypoints('kombu.test'))
        iterep.assert_called_with()
        eps[0].load.assert_called_with()
        eps[1].load.assert_called_with()
Beispiel #3
0
 def test_without_pkg_resources(self):
     assert list(entrypoints('kombu.test')) == []
Beispiel #4
0
 def test_without_pkg_resources(self):
     self.assertListEqual(list(entrypoints('kombu.test')), [])