add test for export key --qr-html

This commit is contained in:
Marian Beermann 2017-02-12 20:40:53 +01:00
parent 79dd920661
commit 04bd6fb013
1 changed files with 13 additions and 0 deletions

View File

@ -1973,6 +1973,19 @@ class ArchiverTestCase(ArchiverTestCaseBase):
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):
export_file = self.output_path + '/exported'
self.cmd('init', self.repository_location, '--encryption', 'keyfile')