test_repo_info.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. import logging
  2. from flexmock import flexmock
  3. from borgmatic.borg import repo_info as module
  4. from ..test_verbosity import insert_logging_mock
  5. def test_display_repository_info_calls_borg_with_flags():
  6. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  7. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  8. flexmock(module.feature).should_receive('available').and_return(True)
  9. flexmock(module.flags).should_receive('make_flags').replace_with(
  10. lambda name, value: (f'--{name}', value) if value else ()
  11. )
  12. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  13. (
  14. '--repo',
  15. 'repo',
  16. )
  17. )
  18. flexmock(module.environment).should_receive('make_environment')
  19. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  20. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  21. ('borg', 'repo-info', '--json', '--repo', 'repo'),
  22. environment=None,
  23. working_directory=None,
  24. borg_local_path='borg',
  25. borg_exit_codes=None,
  26. ).and_return('[]')
  27. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  28. flexmock(module).should_receive('execute_command').with_args(
  29. ('borg', 'repo-info', '--repo', 'repo'),
  30. output_log_level=module.borgmatic.logger.ANSWER,
  31. environment=None,
  32. working_directory=None,
  33. borg_local_path='borg',
  34. borg_exit_codes=None,
  35. )
  36. module.display_repository_info(
  37. repository_path='repo',
  38. config={},
  39. local_borg_version='2.3.4',
  40. repo_info_arguments=flexmock(json=False),
  41. global_arguments=flexmock(),
  42. )
  43. def test_display_repository_info_without_borg_features_calls_borg_with_info_sub_command():
  44. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  45. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  46. flexmock(module.feature).should_receive('available').and_return(False)
  47. flexmock(module.flags).should_receive('make_flags').replace_with(
  48. lambda name, value: (f'--{name}', value) if value else ()
  49. )
  50. flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
  51. flexmock(module.environment).should_receive('make_environment')
  52. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  53. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  54. ('borg', 'repo-info', '--json', 'repo'),
  55. environment=None,
  56. working_directory=None,
  57. borg_local_path='borg',
  58. borg_exit_codes=None,
  59. ).and_return('[]')
  60. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  61. flexmock(module).should_receive('execute_command').with_args(
  62. ('borg', 'info', 'repo'),
  63. output_log_level=module.borgmatic.logger.ANSWER,
  64. environment=None,
  65. working_directory=None,
  66. borg_local_path='borg',
  67. borg_exit_codes=None,
  68. )
  69. module.display_repository_info(
  70. repository_path='repo',
  71. config={},
  72. local_borg_version='2.3.4',
  73. repo_info_arguments=flexmock(json=False),
  74. global_arguments=flexmock(),
  75. )
  76. def test_display_repository_info_with_log_info_calls_borg_with_info_flag():
  77. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  78. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  79. flexmock(module.feature).should_receive('available').and_return(True)
  80. flexmock(module.flags).should_receive('make_flags').replace_with(
  81. lambda name, value: (f'--{name}', value) if value else ()
  82. )
  83. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  84. (
  85. '--repo',
  86. 'repo',
  87. )
  88. )
  89. flexmock(module.environment).should_receive('make_environment')
  90. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  91. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  92. ('borg', 'repo-info', '--info', '--json', '--repo', 'repo'),
  93. environment=None,
  94. working_directory=None,
  95. borg_local_path='borg',
  96. borg_exit_codes=None,
  97. ).and_return('[]')
  98. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  99. flexmock(module).should_receive('execute_command').with_args(
  100. ('borg', 'repo-info', '--info', '--repo', 'repo'),
  101. output_log_level=module.borgmatic.logger.ANSWER,
  102. environment=None,
  103. working_directory=None,
  104. borg_local_path='borg',
  105. borg_exit_codes=None,
  106. )
  107. insert_logging_mock(logging.INFO)
  108. module.display_repository_info(
  109. repository_path='repo',
  110. config={},
  111. local_borg_version='2.3.4',
  112. repo_info_arguments=flexmock(json=False),
  113. global_arguments=flexmock(),
  114. )
  115. def test_display_repository_info_with_log_info_and_json_suppresses_most_borg_output():
  116. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  117. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  118. flexmock(module.feature).should_receive('available').and_return(True)
  119. flexmock(module.flags).should_receive('make_flags').replace_with(
  120. lambda name, value: (f'--{name}', value) if value else ()
  121. )
  122. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  123. (
  124. '--repo',
  125. 'repo',
  126. )
  127. )
  128. flexmock(module.environment).should_receive('make_environment')
  129. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  130. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  131. ('borg', 'repo-info', '--json', '--repo', 'repo'),
  132. environment=None,
  133. working_directory=None,
  134. borg_local_path='borg',
  135. borg_exit_codes=None,
  136. ).and_return('[]')
  137. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags').never()
  138. insert_logging_mock(logging.INFO)
  139. json_output = module.display_repository_info(
  140. repository_path='repo',
  141. config={},
  142. local_borg_version='2.3.4',
  143. repo_info_arguments=flexmock(json=True),
  144. global_arguments=flexmock(),
  145. )
  146. assert json_output == '[]'
  147. def test_display_repository_info_with_log_debug_calls_borg_with_debug_flag():
  148. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  149. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  150. flexmock(module.feature).should_receive('available').and_return(True)
  151. flexmock(module.flags).should_receive('make_flags').replace_with(
  152. lambda name, value: (f'--{name}', value) if value else ()
  153. )
  154. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  155. (
  156. '--repo',
  157. 'repo',
  158. )
  159. )
  160. flexmock(module.environment).should_receive('make_environment')
  161. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  162. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  163. ('borg', 'repo-info', '--debug', '--show-rc', '--json', '--repo', 'repo'),
  164. environment=None,
  165. working_directory=None,
  166. borg_local_path='borg',
  167. borg_exit_codes=None,
  168. ).and_return('[]')
  169. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  170. flexmock(module).should_receive('execute_command').with_args(
  171. ('borg', 'repo-info', '--debug', '--show-rc', '--repo', 'repo'),
  172. output_log_level=module.borgmatic.logger.ANSWER,
  173. environment=None,
  174. working_directory=None,
  175. borg_local_path='borg',
  176. borg_exit_codes=None,
  177. )
  178. insert_logging_mock(logging.DEBUG)
  179. module.display_repository_info(
  180. repository_path='repo',
  181. config={},
  182. local_borg_version='2.3.4',
  183. repo_info_arguments=flexmock(json=False),
  184. global_arguments=flexmock(),
  185. )
  186. def test_display_repository_info_with_log_debug_and_json_suppresses_most_borg_output():
  187. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  188. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  189. flexmock(module.feature).should_receive('available').and_return(True)
  190. flexmock(module.flags).should_receive('make_flags').replace_with(
  191. lambda name, value: (f'--{name}', value) if value else ()
  192. )
  193. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  194. (
  195. '--repo',
  196. 'repo',
  197. )
  198. )
  199. flexmock(module.environment).should_receive('make_environment')
  200. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  201. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  202. ('borg', 'repo-info', '--json', '--repo', 'repo'),
  203. environment=None,
  204. working_directory=None,
  205. borg_local_path='borg',
  206. borg_exit_codes=None,
  207. ).and_return('[]')
  208. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags').never()
  209. insert_logging_mock(logging.DEBUG)
  210. json_output = module.display_repository_info(
  211. repository_path='repo',
  212. config={},
  213. local_borg_version='2.3.4',
  214. repo_info_arguments=flexmock(json=True),
  215. global_arguments=flexmock(),
  216. )
  217. assert json_output == '[]'
  218. def test_display_repository_info_with_json_calls_borg_with_json_flag():
  219. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  220. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  221. flexmock(module.feature).should_receive('available').and_return(True)
  222. flexmock(module.flags).should_receive('make_flags').replace_with(
  223. lambda name, value: (f'--{name}', value) if value else ()
  224. )
  225. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  226. (
  227. '--repo',
  228. 'repo',
  229. )
  230. )
  231. flexmock(module.environment).should_receive('make_environment')
  232. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  233. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  234. ('borg', 'repo-info', '--json', '--repo', 'repo'),
  235. environment=None,
  236. working_directory=None,
  237. borg_local_path='borg',
  238. borg_exit_codes=None,
  239. ).and_return('[]')
  240. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags').never()
  241. json_output = module.display_repository_info(
  242. repository_path='repo',
  243. config={},
  244. local_borg_version='2.3.4',
  245. repo_info_arguments=flexmock(json=True),
  246. global_arguments=flexmock(),
  247. )
  248. assert json_output == '[]'
  249. def test_display_repository_info_with_local_path_calls_borg_via_local_path():
  250. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  251. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  252. flexmock(module.feature).should_receive('available').and_return(True)
  253. flexmock(module.flags).should_receive('make_flags').replace_with(
  254. lambda name, value: (f'--{name}', value) if value else ()
  255. )
  256. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  257. (
  258. '--repo',
  259. 'repo',
  260. )
  261. )
  262. flexmock(module.environment).should_receive('make_environment')
  263. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  264. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  265. ('borg1', 'repo-info', '--json', '--repo', 'repo'),
  266. environment=None,
  267. working_directory=None,
  268. borg_local_path='borg',
  269. borg_exit_codes=None,
  270. ).and_return('[]')
  271. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  272. flexmock(module).should_receive('execute_command').with_args(
  273. ('borg1', 'repo-info', '--repo', 'repo'),
  274. output_log_level=module.borgmatic.logger.ANSWER,
  275. environment=None,
  276. working_directory=None,
  277. borg_local_path='borg1',
  278. borg_exit_codes=None,
  279. )
  280. module.display_repository_info(
  281. repository_path='repo',
  282. config={},
  283. local_borg_version='2.3.4',
  284. repo_info_arguments=flexmock(json=False),
  285. global_arguments=flexmock(),
  286. local_path='borg1',
  287. )
  288. def test_display_repository_info_with_exit_codes_calls_borg_using_them():
  289. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  290. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  291. flexmock(module.feature).should_receive('available').and_return(True)
  292. flexmock(module.flags).should_receive('make_flags').replace_with(
  293. lambda name, value: (f'--{name}', value) if value else ()
  294. )
  295. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  296. (
  297. '--repo',
  298. 'repo',
  299. )
  300. )
  301. flexmock(module.environment).should_receive('make_environment')
  302. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  303. borg_exit_codes = flexmock()
  304. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  305. ('borg', 'repo-info', '--json', '--repo', 'repo'),
  306. environment=None,
  307. working_directory=None,
  308. borg_local_path='borg',
  309. borg_exit_codes=borg_exit_codes,
  310. ).and_return('[]')
  311. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  312. flexmock(module).should_receive('execute_command').with_args(
  313. ('borg', 'repo-info', '--repo', 'repo'),
  314. output_log_level=module.borgmatic.logger.ANSWER,
  315. environment=None,
  316. working_directory=None,
  317. borg_local_path='borg',
  318. borg_exit_codes=borg_exit_codes,
  319. )
  320. module.display_repository_info(
  321. repository_path='repo',
  322. config={'borg_exit_codes': borg_exit_codes},
  323. local_borg_version='2.3.4',
  324. repo_info_arguments=flexmock(json=False),
  325. global_arguments=flexmock(),
  326. )
  327. def test_display_repository_info_with_remote_path_calls_borg_with_remote_path_flags():
  328. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  329. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  330. flexmock(module.feature).should_receive('available').and_return(True)
  331. flexmock(module.flags).should_receive('make_flags').replace_with(
  332. lambda name, value: (f'--{name}', value) if value else ()
  333. )
  334. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  335. (
  336. '--repo',
  337. 'repo',
  338. )
  339. )
  340. flexmock(module.environment).should_receive('make_environment')
  341. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  342. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  343. ('borg', 'repo-info', '--remote-path', 'borg1', '--json', '--repo', 'repo'),
  344. environment=None,
  345. working_directory=None,
  346. borg_local_path='borg',
  347. borg_exit_codes=None,
  348. ).and_return('[]')
  349. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  350. flexmock(module).should_receive('execute_command').with_args(
  351. ('borg', 'repo-info', '--remote-path', 'borg1', '--repo', 'repo'),
  352. output_log_level=module.borgmatic.logger.ANSWER,
  353. environment=None,
  354. working_directory=None,
  355. borg_local_path='borg',
  356. borg_exit_codes=None,
  357. )
  358. module.display_repository_info(
  359. repository_path='repo',
  360. config={},
  361. local_borg_version='2.3.4',
  362. repo_info_arguments=flexmock(json=False),
  363. global_arguments=flexmock(),
  364. remote_path='borg1',
  365. )
  366. def test_display_repository_info_with_umask_calls_borg_with_umask_flags():
  367. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  368. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  369. flexmock(module.feature).should_receive('available').and_return(True)
  370. flexmock(module.flags).should_receive('make_flags').replace_with(
  371. lambda name, value: (f'--{name}', value) if value else ()
  372. )
  373. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  374. (
  375. '--repo',
  376. 'repo',
  377. )
  378. )
  379. flexmock(module.environment).should_receive('make_environment')
  380. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  381. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  382. ('borg', 'repo-info', '--umask', '077', '--json', '--repo', 'repo'),
  383. environment=None,
  384. working_directory=None,
  385. borg_local_path='borg',
  386. borg_exit_codes=None,
  387. ).and_return('[]')
  388. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  389. flexmock(module).should_receive('execute_command').with_args(
  390. ('borg', 'repo-info', '--umask', '077', '--repo', 'repo'),
  391. output_log_level=module.borgmatic.logger.ANSWER,
  392. environment=None,
  393. working_directory=None,
  394. borg_local_path='borg',
  395. borg_exit_codes=None,
  396. )
  397. module.display_repository_info(
  398. repository_path='repo',
  399. config={'umask': '077'},
  400. local_borg_version='2.3.4',
  401. repo_info_arguments=flexmock(json=False),
  402. global_arguments=flexmock(),
  403. remote_path=None,
  404. )
  405. def test_display_repository_info_with_log_json_calls_borg_with_log_json_flags():
  406. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  407. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  408. flexmock(module.feature).should_receive('available').and_return(True)
  409. flexmock(module.flags).should_receive('make_flags').replace_with(
  410. lambda name, value: (f'--{name}', value) if value else ()
  411. )
  412. flexmock(module.flags).should_receive('make_flags').with_args('log-json', True).and_return(
  413. ('--log-json',)
  414. )
  415. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  416. (
  417. '--repo',
  418. 'repo',
  419. )
  420. )
  421. flexmock(module.environment).should_receive('make_environment')
  422. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  423. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  424. ('borg', 'repo-info', '--log-json', '--json', '--repo', 'repo'),
  425. environment=None,
  426. working_directory=None,
  427. borg_local_path='borg',
  428. borg_exit_codes=None,
  429. ).and_return('[]')
  430. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  431. flexmock(module).should_receive('execute_command').with_args(
  432. ('borg', 'repo-info', '--log-json', '--repo', 'repo'),
  433. output_log_level=module.borgmatic.logger.ANSWER,
  434. environment=None,
  435. working_directory=None,
  436. borg_local_path='borg',
  437. borg_exit_codes=None,
  438. )
  439. module.display_repository_info(
  440. repository_path='repo',
  441. config={'log_json': True},
  442. local_borg_version='2.3.4',
  443. repo_info_arguments=flexmock(json=False),
  444. global_arguments=flexmock(),
  445. )
  446. def test_display_repository_info_with_lock_wait_calls_borg_with_lock_wait_flags():
  447. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  448. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  449. config = {'lock_wait': 5}
  450. flexmock(module.feature).should_receive('available').and_return(True)
  451. flexmock(module.flags).should_receive('make_flags').replace_with(
  452. lambda name, value: (f'--{name}', str(value)) if value else ()
  453. )
  454. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  455. (
  456. '--repo',
  457. 'repo',
  458. )
  459. )
  460. flexmock(module.environment).should_receive('make_environment')
  461. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None)
  462. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  463. ('borg', 'repo-info', '--lock-wait', '5', '--json', '--repo', 'repo'),
  464. environment=None,
  465. working_directory=None,
  466. borg_local_path='borg',
  467. borg_exit_codes=None,
  468. ).and_return('[]')
  469. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  470. flexmock(module).should_receive('execute_command').with_args(
  471. ('borg', 'repo-info', '--lock-wait', '5', '--repo', 'repo'),
  472. output_log_level=module.borgmatic.logger.ANSWER,
  473. environment=None,
  474. working_directory=None,
  475. borg_local_path='borg',
  476. borg_exit_codes=None,
  477. )
  478. module.display_repository_info(
  479. repository_path='repo',
  480. config=config,
  481. local_borg_version='2.3.4',
  482. repo_info_arguments=flexmock(json=False),
  483. global_arguments=flexmock(),
  484. )
  485. def test_display_repository_info_calls_borg_with_working_directory():
  486. flexmock(module.borgmatic.logger).should_receive('add_custom_log_levels')
  487. flexmock(module.logging).ANSWER = module.borgmatic.logger.ANSWER
  488. flexmock(module.feature).should_receive('available').and_return(True)
  489. flexmock(module.flags).should_receive('make_flags').replace_with(
  490. lambda name, value: (f'--{name}', value) if value else ()
  491. )
  492. flexmock(module.flags).should_receive('make_repository_flags').and_return(
  493. (
  494. '--repo',
  495. 'repo',
  496. )
  497. )
  498. flexmock(module.environment).should_receive('make_environment')
  499. flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(
  500. '/working/dir',
  501. )
  502. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  503. ('borg', 'repo-info', '--json', '--repo', 'repo'),
  504. environment=None,
  505. working_directory='/working/dir',
  506. borg_local_path='borg',
  507. borg_exit_codes=None,
  508. ).and_return('[]')
  509. flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
  510. flexmock(module).should_receive('execute_command').with_args(
  511. ('borg', 'repo-info', '--repo', 'repo'),
  512. output_log_level=module.borgmatic.logger.ANSWER,
  513. environment=None,
  514. working_directory='/working/dir',
  515. borg_local_path='borg',
  516. borg_exit_codes=None,
  517. )
  518. module.display_repository_info(
  519. repository_path='repo',
  520. config={},
  521. local_borg_version='2.3.4',
  522. repo_info_arguments=flexmock(json=False),
  523. global_arguments=flexmock(),
  524. )