test_list.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. import argparse
  2. import logging
  3. import pytest
  4. from flexmock import flexmock
  5. from borgmatic.borg import list as module
  6. from ..test_verbosity import insert_logging_mock
  7. def test_make_list_command_includes_log_info():
  8. insert_logging_mock(logging.INFO)
  9. flexmock(module.flags).should_receive('make_flags').and_return(())
  10. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(())
  11. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  12. command = module.make_list_command(
  13. repository='repo',
  14. storage_config={},
  15. local_borg_version='1.2.3',
  16. list_arguments=flexmock(archive=None, paths=None, json=False),
  17. )
  18. assert command == ('borg', 'list', '--info', 'repo')
  19. def test_make_list_command_includes_json_but_not_info():
  20. insert_logging_mock(logging.INFO)
  21. flexmock(module.flags).should_receive('make_flags').and_return(())
  22. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(('--json',))
  23. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  24. command = module.make_list_command(
  25. repository='repo',
  26. storage_config={},
  27. local_borg_version='1.2.3',
  28. list_arguments=flexmock(archive=None, paths=None, json=True),
  29. )
  30. assert command == ('borg', 'list', '--json', 'repo')
  31. def test_make_list_command_includes_log_debug():
  32. insert_logging_mock(logging.DEBUG)
  33. flexmock(module.flags).should_receive('make_flags').and_return(())
  34. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(())
  35. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  36. command = module.make_list_command(
  37. repository='repo',
  38. storage_config={},
  39. local_borg_version='1.2.3',
  40. list_arguments=flexmock(archive=None, paths=None, json=False),
  41. )
  42. assert command == ('borg', 'list', '--debug', '--show-rc', 'repo')
  43. def test_make_list_command_includes_json_but_not_debug():
  44. insert_logging_mock(logging.DEBUG)
  45. flexmock(module.flags).should_receive('make_flags').and_return(())
  46. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(('--json',))
  47. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  48. command = module.make_list_command(
  49. repository='repo',
  50. storage_config={},
  51. local_borg_version='1.2.3',
  52. list_arguments=flexmock(archive=None, paths=None, json=True),
  53. )
  54. assert command == ('borg', 'list', '--json', 'repo')
  55. def test_make_list_command_includes_json():
  56. flexmock(module.flags).should_receive('make_flags').and_return(())
  57. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(('--json',))
  58. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  59. command = module.make_list_command(
  60. repository='repo',
  61. storage_config={},
  62. local_borg_version='1.2.3',
  63. list_arguments=flexmock(archive=None, paths=None, json=True),
  64. )
  65. assert command == ('borg', 'list', '--json', 'repo')
  66. def test_make_list_command_includes_lock_wait():
  67. flexmock(module.flags).should_receive('make_flags').and_return(()).and_return(
  68. ('--lock-wait', '5')
  69. )
  70. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(())
  71. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  72. command = module.make_list_command(
  73. repository='repo',
  74. storage_config={'lock_wait': 5},
  75. local_borg_version='1.2.3',
  76. list_arguments=flexmock(archive=None, paths=None, json=False),
  77. )
  78. assert command == ('borg', 'list', '--lock-wait', '5', 'repo')
  79. def test_make_list_command_includes_archive():
  80. flexmock(module.flags).should_receive('make_flags').and_return(())
  81. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(())
  82. flexmock(module.flags).should_receive('make_repository_archive_flags').and_return(
  83. ('repo::archive',)
  84. )
  85. command = module.make_list_command(
  86. repository='repo',
  87. storage_config={},
  88. local_borg_version='1.2.3',
  89. list_arguments=flexmock(archive='archive', paths=None, json=False),
  90. )
  91. assert command == ('borg', 'list', 'repo::archive')
  92. def test_make_list_command_includes_archive_and_path():
  93. flexmock(module.flags).should_receive('make_flags').and_return(())
  94. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(())
  95. flexmock(module.flags).should_receive('make_repository_archive_flags').and_return(
  96. ('repo::archive',)
  97. )
  98. command = module.make_list_command(
  99. repository='repo',
  100. storage_config={},
  101. local_borg_version='1.2.3',
  102. list_arguments=flexmock(archive='archive', paths=['var/lib'], json=False),
  103. )
  104. assert command == ('borg', 'list', 'repo::archive', 'var/lib')
  105. def test_make_list_command_includes_local_path():
  106. flexmock(module.flags).should_receive('make_flags').and_return(())
  107. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(())
  108. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  109. command = module.make_list_command(
  110. repository='repo',
  111. storage_config={},
  112. local_borg_version='1.2.3',
  113. list_arguments=flexmock(archive=None, paths=None, json=False),
  114. local_path='borg2',
  115. )
  116. assert command == ('borg2', 'list', 'repo')
  117. def test_make_list_command_includes_remote_path():
  118. flexmock(module.flags).should_receive('make_flags').and_return(
  119. ('--remote-path', 'borg2')
  120. ).and_return(())
  121. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(())
  122. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  123. command = module.make_list_command(
  124. repository='repo',
  125. storage_config={},
  126. local_borg_version='1.2.3',
  127. list_arguments=flexmock(archive=None, paths=None, json=False),
  128. remote_path='borg2',
  129. )
  130. assert command == ('borg', 'list', '--remote-path', 'borg2', 'repo')
  131. def test_make_list_command_includes_short():
  132. flexmock(module.flags).should_receive('make_flags').and_return(())
  133. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(('--short',))
  134. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  135. command = module.make_list_command(
  136. repository='repo',
  137. storage_config={},
  138. local_borg_version='1.2.3',
  139. list_arguments=flexmock(archive=None, paths=None, json=False, short=True),
  140. )
  141. assert command == ('borg', 'list', '--short', 'repo')
  142. @pytest.mark.parametrize(
  143. 'argument_name',
  144. (
  145. 'prefix',
  146. 'match_archives',
  147. 'sort_by',
  148. 'first',
  149. 'last',
  150. 'exclude',
  151. 'exclude_from',
  152. 'pattern',
  153. 'patterns_from',
  154. ),
  155. )
  156. def test_make_list_command_includes_additional_flags(argument_name):
  157. flexmock(module.flags).should_receive('make_flags').and_return(())
  158. flexmock(module.flags).should_receive('make_flags_from_arguments').and_return(
  159. (f"--{argument_name.replace('_', '-')}", 'value')
  160. )
  161. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  162. command = module.make_list_command(
  163. repository='repo',
  164. storage_config={},
  165. local_borg_version='1.2.3',
  166. list_arguments=flexmock(
  167. archive=None,
  168. paths=None,
  169. json=False,
  170. find_paths=None,
  171. format=None,
  172. **{argument_name: 'value'},
  173. ),
  174. )
  175. assert command == ('borg', 'list', '--' + argument_name.replace('_', '-'), 'value', 'repo')
  176. def test_make_find_paths_considers_none_as_empty_paths():
  177. assert module.make_find_paths(None) == ()
  178. def test_make_find_paths_passes_through_patterns():
  179. find_paths = (
  180. 'fm:*',
  181. 'sh:**/*.txt',
  182. 're:^.*$',
  183. 'pp:root/somedir',
  184. 'pf:root/foo.txt',
  185. 'R /',
  186. 'r /',
  187. 'p /',
  188. 'P /',
  189. '+ /',
  190. '- /',
  191. '! /',
  192. )
  193. assert module.make_find_paths(find_paths) == find_paths
  194. def test_make_find_paths_adds_globs_to_path_fragments():
  195. assert module.make_find_paths(('foo.txt',)) == ('sh:**/*foo.txt*/**',)
  196. def test_list_archive_calls_borg_with_parameters():
  197. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  198. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  199. flexmock(module.logger).answer = lambda message: None
  200. list_arguments = argparse.Namespace(
  201. archive='archive',
  202. paths=None,
  203. json=False,
  204. find_paths=None,
  205. prefix=None,
  206. match_archives=None,
  207. sort_by=None,
  208. first=None,
  209. last=None,
  210. )
  211. flexmock(module.feature).should_receive('available').and_return(False)
  212. flexmock(module).should_receive('make_list_command').with_args(
  213. repository='repo',
  214. storage_config={},
  215. local_borg_version='1.2.3',
  216. list_arguments=list_arguments,
  217. local_path='borg',
  218. remote_path=None,
  219. ).and_return(('borg', 'list', 'repo::archive'))
  220. flexmock(module).should_receive('make_find_paths').and_return(())
  221. flexmock(module.environment).should_receive('make_environment')
  222. flexmock(module).should_receive('execute_command').with_args(
  223. ('borg', 'list', 'repo::archive'),
  224. output_log_level=module.borgmatic.logger.ANSWER,
  225. borg_local_path='borg',
  226. extra_environment=None,
  227. ).once()
  228. module.list_archive(
  229. repository='repo',
  230. storage_config={},
  231. local_borg_version='1.2.3',
  232. list_arguments=list_arguments,
  233. )
  234. def test_list_archive_with_archive_and_json_errors():
  235. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  236. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  237. flexmock(module.logger).answer = lambda message: None
  238. list_arguments = argparse.Namespace(archive='archive', paths=None, json=True, find_paths=None)
  239. flexmock(module.feature).should_receive('available').and_return(False)
  240. with pytest.raises(ValueError):
  241. module.list_archive(
  242. repository='repo',
  243. storage_config={},
  244. local_borg_version='1.2.3',
  245. list_arguments=list_arguments,
  246. )
  247. def test_list_archive_calls_borg_with_local_path():
  248. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  249. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  250. flexmock(module.logger).answer = lambda message: None
  251. list_arguments = argparse.Namespace(
  252. archive='archive',
  253. paths=None,
  254. json=False,
  255. find_paths=None,
  256. prefix=None,
  257. match_archives=None,
  258. sort_by=None,
  259. first=None,
  260. last=None,
  261. )
  262. flexmock(module.feature).should_receive('available').and_return(False)
  263. flexmock(module).should_receive('make_list_command').with_args(
  264. repository='repo',
  265. storage_config={},
  266. local_borg_version='1.2.3',
  267. list_arguments=list_arguments,
  268. local_path='borg2',
  269. remote_path=None,
  270. ).and_return(('borg2', 'list', 'repo::archive'))
  271. flexmock(module).should_receive('make_find_paths').and_return(())
  272. flexmock(module.environment).should_receive('make_environment')
  273. flexmock(module).should_receive('execute_command').with_args(
  274. ('borg2', 'list', 'repo::archive'),
  275. output_log_level=module.borgmatic.logger.ANSWER,
  276. borg_local_path='borg2',
  277. extra_environment=None,
  278. ).once()
  279. module.list_archive(
  280. repository='repo',
  281. storage_config={},
  282. local_borg_version='1.2.3',
  283. list_arguments=list_arguments,
  284. local_path='borg2',
  285. )
  286. def test_list_archive_calls_borg_multiple_times_with_find_paths():
  287. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  288. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  289. flexmock(module.logger).answer = lambda message: None
  290. glob_paths = ('**/*foo.txt*/**',)
  291. list_arguments = argparse.Namespace(
  292. archive=None,
  293. json=False,
  294. find_paths=['foo.txt'],
  295. prefix=None,
  296. match_archives=None,
  297. sort_by=None,
  298. first=None,
  299. last=None,
  300. )
  301. flexmock(module.feature).should_receive('available').and_return(False)
  302. flexmock(module.rlist).should_receive('make_rlist_command').and_return(('borg', 'list', 'repo'))
  303. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  304. ('borg', 'list', 'repo'), extra_environment=None,
  305. ).and_return('archive1\narchive2').once()
  306. flexmock(module).should_receive('make_list_command').and_return(
  307. ('borg', 'list', 'repo::archive1')
  308. ).and_return(('borg', 'list', 'repo::archive2'))
  309. flexmock(module).should_receive('make_find_paths').and_return(glob_paths)
  310. flexmock(module.environment).should_receive('make_environment')
  311. flexmock(module).should_receive('execute_command').with_args(
  312. ('borg', 'list', 'repo::archive1') + glob_paths,
  313. output_log_level=module.borgmatic.logger.ANSWER,
  314. borg_local_path='borg',
  315. extra_environment=None,
  316. ).once()
  317. flexmock(module).should_receive('execute_command').with_args(
  318. ('borg', 'list', 'repo::archive2') + glob_paths,
  319. output_log_level=module.borgmatic.logger.ANSWER,
  320. borg_local_path='borg',
  321. extra_environment=None,
  322. ).once()
  323. module.list_archive(
  324. repository='repo',
  325. storage_config={},
  326. local_borg_version='1.2.3',
  327. list_arguments=list_arguments,
  328. )
  329. def test_list_archive_calls_borg_with_archive():
  330. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  331. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  332. flexmock(module.logger).answer = lambda message: None
  333. list_arguments = argparse.Namespace(
  334. archive='archive',
  335. paths=None,
  336. json=False,
  337. find_paths=None,
  338. prefix=None,
  339. match_archives=None,
  340. sort_by=None,
  341. first=None,
  342. last=None,
  343. )
  344. flexmock(module.feature).should_receive('available').and_return(False)
  345. flexmock(module).should_receive('make_list_command').with_args(
  346. repository='repo',
  347. storage_config={},
  348. local_borg_version='1.2.3',
  349. list_arguments=list_arguments,
  350. local_path='borg',
  351. remote_path=None,
  352. ).and_return(('borg', 'list', 'repo::archive'))
  353. flexmock(module).should_receive('make_find_paths').and_return(())
  354. flexmock(module.environment).should_receive('make_environment')
  355. flexmock(module).should_receive('execute_command').with_args(
  356. ('borg', 'list', 'repo::archive'),
  357. output_log_level=module.borgmatic.logger.ANSWER,
  358. borg_local_path='borg',
  359. extra_environment=None,
  360. ).once()
  361. module.list_archive(
  362. repository='repo',
  363. storage_config={},
  364. local_borg_version='1.2.3',
  365. list_arguments=list_arguments,
  366. )
  367. def test_list_archive_without_archive_delegates_to_list_repository():
  368. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  369. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  370. flexmock(module.logger).answer = lambda message: None
  371. list_arguments = argparse.Namespace(
  372. archive=None,
  373. short=None,
  374. format=None,
  375. json=None,
  376. prefix=None,
  377. match_archives=None,
  378. sort_by=None,
  379. first=None,
  380. last=None,
  381. find_paths=None,
  382. )
  383. flexmock(module.feature).should_receive('available').and_return(False)
  384. flexmock(module.rlist).should_receive('list_repository')
  385. flexmock(module.environment).should_receive('make_environment').never()
  386. flexmock(module).should_receive('execute_command').never()
  387. module.list_archive(
  388. repository='repo',
  389. storage_config={},
  390. local_borg_version='1.2.3',
  391. list_arguments=list_arguments,
  392. )
  393. def test_list_archive_with_borg_features_without_archive_delegates_to_list_repository():
  394. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  395. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  396. flexmock(module.logger).answer = lambda message: None
  397. list_arguments = argparse.Namespace(
  398. archive=None,
  399. short=None,
  400. format=None,
  401. json=None,
  402. prefix=None,
  403. match_archives=None,
  404. sort_by=None,
  405. first=None,
  406. last=None,
  407. find_paths=None,
  408. )
  409. flexmock(module.feature).should_receive('available').and_return(True)
  410. flexmock(module.rlist).should_receive('list_repository')
  411. flexmock(module.environment).should_receive('make_environment').never()
  412. flexmock(module).should_receive('execute_command').never()
  413. module.list_archive(
  414. repository='repo',
  415. storage_config={},
  416. local_borg_version='1.2.3',
  417. list_arguments=list_arguments,
  418. )
  419. @pytest.mark.parametrize(
  420. 'archive_filter_flag', ('prefix', 'match_archives', 'sort_by', 'first', 'last',),
  421. )
  422. def test_list_archive_with_archive_ignores_archive_filter_flag(archive_filter_flag,):
  423. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  424. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  425. flexmock(module.logger).answer = lambda message: None
  426. default_filter_flags = {
  427. 'prefix': None,
  428. 'match_archives': None,
  429. 'sort_by': None,
  430. 'first': None,
  431. 'last': None,
  432. }
  433. altered_filter_flags = {**default_filter_flags, **{archive_filter_flag: 'foo'}}
  434. flexmock(module.feature).should_receive('available').with_args(
  435. module.feature.Feature.RLIST, '1.2.3'
  436. ).and_return(False)
  437. flexmock(module).should_receive('make_list_command').with_args(
  438. repository='repo',
  439. storage_config={},
  440. local_borg_version='1.2.3',
  441. list_arguments=argparse.Namespace(
  442. archive='archive', paths=None, json=False, find_paths=None, **default_filter_flags
  443. ),
  444. local_path='borg',
  445. remote_path=None,
  446. ).and_return(('borg', 'list', 'repo::archive'))
  447. flexmock(module).should_receive('make_find_paths').and_return(())
  448. flexmock(module.environment).should_receive('make_environment')
  449. flexmock(module).should_receive('execute_command').with_args(
  450. ('borg', 'list', 'repo::archive'),
  451. output_log_level=module.borgmatic.logger.ANSWER,
  452. borg_local_path='borg',
  453. extra_environment=None,
  454. ).once()
  455. module.list_archive(
  456. repository='repo',
  457. storage_config={},
  458. local_borg_version='1.2.3',
  459. list_arguments=argparse.Namespace(
  460. archive='archive', paths=None, json=False, find_paths=None, **altered_filter_flags
  461. ),
  462. )
  463. @pytest.mark.parametrize(
  464. 'archive_filter_flag', ('prefix', 'match_archives', 'sort_by', 'first', 'last',),
  465. )
  466. def test_list_archive_with_find_paths_allows_archive_filter_flag_but_only_passes_it_to_rlist(
  467. archive_filter_flag,
  468. ):
  469. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  470. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  471. flexmock(module.logger).answer = lambda message: None
  472. default_filter_flags = {
  473. 'prefix': None,
  474. 'match_archives': None,
  475. 'sort_by': None,
  476. 'first': None,
  477. 'last': None,
  478. }
  479. altered_filter_flags = {**default_filter_flags, **{archive_filter_flag: 'foo'}}
  480. glob_paths = ('**/*foo.txt*/**',)
  481. flexmock(module.feature).should_receive('available').and_return(True)
  482. flexmock(module.rlist).should_receive('make_rlist_command').with_args(
  483. repository='repo',
  484. storage_config={},
  485. local_borg_version='1.2.3',
  486. rlist_arguments=argparse.Namespace(
  487. repository='repo', short=True, format=None, json=None, **altered_filter_flags
  488. ),
  489. local_path='borg',
  490. remote_path=None,
  491. ).and_return(('borg', 'rlist', '--repo', 'repo'))
  492. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  493. ('borg', 'rlist', '--repo', 'repo'), extra_environment=None,
  494. ).and_return('archive1\narchive2').once()
  495. flexmock(module).should_receive('make_list_command').with_args(
  496. repository='repo',
  497. storage_config={},
  498. local_borg_version='1.2.3',
  499. list_arguments=argparse.Namespace(
  500. repository='repo',
  501. archive='archive1',
  502. paths=None,
  503. short=True,
  504. format=None,
  505. json=None,
  506. find_paths=['foo.txt'],
  507. **default_filter_flags,
  508. ),
  509. local_path='borg',
  510. remote_path=None,
  511. ).and_return(('borg', 'list', '--repo', 'repo', 'archive1'))
  512. flexmock(module).should_receive('make_list_command').with_args(
  513. repository='repo',
  514. storage_config={},
  515. local_borg_version='1.2.3',
  516. list_arguments=argparse.Namespace(
  517. repository='repo',
  518. archive='archive2',
  519. paths=None,
  520. short=True,
  521. format=None,
  522. json=None,
  523. find_paths=['foo.txt'],
  524. **default_filter_flags,
  525. ),
  526. local_path='borg',
  527. remote_path=None,
  528. ).and_return(('borg', 'list', '--repo', 'repo', 'archive2'))
  529. flexmock(module).should_receive('make_find_paths').and_return(glob_paths)
  530. flexmock(module.environment).should_receive('make_environment')
  531. flexmock(module).should_receive('execute_command').with_args(
  532. ('borg', 'list', '--repo', 'repo', 'archive1') + glob_paths,
  533. output_log_level=module.borgmatic.logger.ANSWER,
  534. borg_local_path='borg',
  535. extra_environment=None,
  536. ).once()
  537. flexmock(module).should_receive('execute_command').with_args(
  538. ('borg', 'list', '--repo', 'repo', 'archive2') + glob_paths,
  539. output_log_level=module.borgmatic.logger.ANSWER,
  540. borg_local_path='borg',
  541. extra_environment=None,
  542. ).once()
  543. module.list_archive(
  544. repository='repo',
  545. storage_config={},
  546. local_borg_version='1.2.3',
  547. list_arguments=argparse.Namespace(
  548. repository='repo',
  549. archive=None,
  550. paths=None,
  551. short=True,
  552. format=None,
  553. json=None,
  554. find_paths=['foo.txt'],
  555. **altered_filter_flags,
  556. ),
  557. )