コード例 #1
0
 def test_list_scripts(self, patch_logger):
     parser = CatParser()
     parser.cat_files_iterator = MagicMock(return_value=self.CAT_FILES)
     parser.list(cat_filename='path/to/catfile.cat')
     parser.cat_files_iterator.assert_called_once_with(
         'path/to/catfile.cat')
     patch_logger.info.assert_called_once_with('%60s (%10d)',
                                               'some path/filename1.xml',
                                               101)
コード例 #2
0
 def test_list_all_no_sig(self, patch_logger):
     parser = CatParser(scripts_only=False)
     parser.cat_files_iterator = MagicMock(return_value=self.CAT_FILES)
     parser.list(cat_filename='path/to/catfile.cat')
     parser.cat_files_iterator.assert_called_once_with(
         'path/to/catfile.cat')
     self.assertEqual(patch_logger.info.call_count, 2)
     patch_logger.info.assert_has_calls([
         call('%60s (%10d)', 'some path/filename1.xml', 101),
         call('%60s (%10d)', 'some path/filename2.xmf', 300),
     ])