Example #1
0
 def test_run_overrides(self, tree_mock):
     '''
     Test running with pattern and extension overrides.
     '''
     run(['myfile', '-p', 'some_regex', '-e', '.txt'])
     tree_mock.assert_called_once_with(['myfile'],
                                       pattern='some_regex',
                                       extension='.txt')
Example #2
0
 def test_run_one_file(self, tree_mock):
     '''
     Test running command with one file.
     '''
     run(['myfile'])
     tree_mock.assert_called_once_with(['myfile'],
                                       extension=DEFAULT_EXTENSION,
                                       pattern=DEFAULT_DEPENDENCY_REGEX)
Example #3
0
 def test_run_multiple_files(self, tree_mock):
     '''
     Test running command with multiple files.
     '''
     run(['file_1', 'file_2', 'file_3'])
     tree_mock.assert_called_once_with(['file_1',
                                        'file_2',
                                        'file_3'],
                                       extension=DEFAULT_EXTENSION,
                                       pattern=DEFAULT_DEPENDENCY_REGEX)