Esempio n. 1
0
    def test_load_entry_point_passes_require_argument_to_load(self):
        entry_point = mock.Mock(spec=['load'])

        engine._load_entry_point(entry_point, verify_requirements=True)
        entry_point.load.assert_called_once_with(require=True)
        entry_point.reset_mock()

        engine._load_entry_point(entry_point, verify_requirements=False)
        entry_point.load.assert_called_once_with(require=False)
Esempio n. 2
0
    def test_load_entry_point_passes_require_argument_to_load(self):
        entry_point = mock.Mock(spec=['load'])

        engine._load_entry_point(entry_point, verify_requirements=True)
        entry_point.load.assert_called_once_with(require=True)
        entry_point.reset_mock()

        engine._load_entry_point(entry_point, verify_requirements=False)
        entry_point.load.assert_called_once_with(require=False)
Esempio n. 3
0
    def test_load_entry_point_does_not_verify_requirements(self):
        entry_point = mock.Mock(spec=['require', 'resolve', 'load'])

        engine._load_entry_point(entry_point, verify_requirements=False)
        self.assertFalse(entry_point.require.called)
        entry_point.resolve.assert_called_once_with()
Esempio n. 4
0
    def test_load_entry_point_verifies_requirements(self):
        entry_point = mock.Mock(spec=['require', 'resolve', 'load'])

        engine._load_entry_point(entry_point, verify_requirements=True)
        entry_point.require.assert_called_once_with()
        entry_point.resolve.assert_called_once_with()
Esempio n. 5
0
    def test_load_entry_point_does_not_verify_requirements(self):
        entry_point = mock.Mock(spec=['require', 'resolve', 'load'])

        engine._load_entry_point(entry_point, verify_requirements=False)
        self.assertFalse(entry_point.require.called)
        entry_point.resolve.assert_called_once_with()
Esempio n. 6
0
    def test_load_entry_point_verifies_requirements(self):
        entry_point = mock.Mock(spec=['require', 'resolve', 'load'])

        engine._load_entry_point(entry_point, verify_requirements=True)
        entry_point.require.assert_called_once_with()
        entry_point.resolve.assert_called_once_with()