def test_should_discover_modules_by_glob(self, mock_discover_modules_matching, mock_unittest, runner, tool):
        pipe = Mock()
        pipe.remote_close_cause.return_value = None
        tool.return_value = (Mock(), pipe)
        execute_tests_matching(Mock(), [], runner, self.mock_logger, "/path/to/test/sources", "*_tests.py", ["a", "b"])

        mock_discover_modules_matching.assert_called_with("/path/to/test/sources", "*_tests.py")
Ejemplo n.º 2
0
    def test_should_load_tests_from_discovered_modules(self, mock_discover_modules_matching, mock_unittest, runner):
        mock_modules = Mock()
        mock_discover_modules_matching.return_value = mock_modules

        execute_tests_matching(runner, self.mock_logger, '/path/to/test/sources', '*_tests.py')

        mock_unittest.defaultTestLoader.loadTestsFromNames.assert_called_with(mock_modules)
Ejemplo n.º 3
0
    def test_should_load_tests_from_discovered_modules(self, mock_discover_modules_matching, mock_unittest, runner):
        mock_modules = Mock()
        mock_discover_modules_matching.return_value = mock_modules

        execute_tests_matching(runner, self.mock_logger, '/path/to/test/sources', '*_tests.py')

        mock_unittest.defaultTestLoader.loadTestsFromNames.assert_called_with(mock_modules)
Ejemplo n.º 4
0
    def test_should_discover_modules_by_glob(self,
                                             mock_discover_modules_matching,
                                             mock_unittest, runner):
        execute_tests_matching(runner, self.mock_logger,
                               '/path/to/test/sources', '*_tests.py')

        mock_discover_modules_matching.assert_called_with(
            '/path/to/test/sources', '*_tests.py')
Ejemplo n.º 5
0
    def test_should_discover_modules_by_glob(self, mock_discover_modules_matching, mock_unittest, runner):

        execute_tests_matching("/path/to/test/sources", "*_tests.py")

        mock_discover_modules_matching.assert_called_with("/path/to/test/sources", "*_tests.py")
Ejemplo n.º 6
0
    def test_should_discover_modules_by_glob(self, mock_discover_modules_matching, mock_unittest, runner):
        execute_tests_matching(runner, self.mock_logger, '/path/to/test/sources', '*_tests.py')

        mock_discover_modules_matching.assert_called_with('/path/to/test/sources', '*_tests.py')