mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-24 16:55:36 +00:00
add test for export key --qr-html
This commit is contained in:
parent
79dd920661
commit
04bd6fb013
1 changed files with 13 additions and 0 deletions
|
@ -1973,6 +1973,19 @@ def test_key_export_repokey(self):
|
||||||
|
|
||||||
assert repo_key2.enc_key == repo_key2.enc_key
|
assert repo_key2.enc_key == repo_key2.enc_key
|
||||||
|
|
||||||
|
def test_key_export_qr(self):
|
||||||
|
export_file = self.output_path + '/exported.html'
|
||||||
|
self.cmd('init', self.repository_location, '--encryption', 'repokey')
|
||||||
|
repo_id = self._extract_repository_id(self.repository_path)
|
||||||
|
self.cmd('key', 'export', '--qr-html', self.repository_location, export_file)
|
||||||
|
|
||||||
|
with open(export_file, 'r') as fd:
|
||||||
|
export_contents = fd.read()
|
||||||
|
|
||||||
|
assert bin_to_hex(repo_id) in export_contents
|
||||||
|
assert export_contents.startswith('<!doctype html>')
|
||||||
|
assert export_contents.endswith('</html>')
|
||||||
|
|
||||||
def test_key_import_errors(self):
|
def test_key_import_errors(self):
|
||||||
export_file = self.output_path + '/exported'
|
export_file = self.output_path + '/exported'
|
||||||
self.cmd('init', self.repository_location, '--encryption', 'keyfile')
|
self.cmd('init', self.repository_location, '--encryption', 'keyfile')
|
||||||
|
|
Loading…
Reference in a new issue