1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 01:06:50 +00:00

Add test for: info: emit repo info even if repo has 0 archives (#6155)

add test for: info: emit repo info even if repo has 0 archives

In https://github.com/borgbackup/borg/pull/6152 it has been neglected to
add a regression test for the bug that has been fixed. This is the test.
This commit is contained in:
Andrey Bienkowski 2022-01-22 20:53:17 +00:00 committed by GitHub
parent 8b61fd308c
commit aa77957f68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1538,6 +1538,14 @@ def test_info_json(self):
assert datetime.strptime(archive['start'], ISO_FORMAT)
assert datetime.strptime(archive['end'], ISO_FORMAT)
def test_info_json_of_empty_archive(self):
"""See https://github.com/borgbackup/borg/issues/6120"""
self.cmd('init', '--encryption=repokey', self.repository_location)
info_repo = json.loads(self.cmd('info', '--json', '--first=1', self.repository_location))
assert info_repo["archives"] == []
info_repo = json.loads(self.cmd('info', '--json', '--last=1', self.repository_location))
assert info_repo["archives"] == []
def test_comment(self):
self.create_regular_file('file1', size=1024 * 80)
self.cmd('init', '--encryption=repokey', self.repository_location)