Back to index

obnam  1.1
Public Member Functions | Public Attributes
obnamlib.encryption_tests.KeyringTests Class Reference

List of all members.

Public Member Functions

def setUp
def test_has_no_keys_initially
def test_gets_no_keys_from_empty_encoded
def test_adds_key
def test_removes_key
def test_export_import_roundtrip_works

Public Attributes

 keyring
 keyid
 key

Detailed Description

Definition at line 114 of file encryption_tests.py.


Member Function Documentation

Definition at line 116 of file encryption_tests.py.

00116 
00117     def setUp(self):
00118         self.keyring = obnamlib.Keyring()
00119         self.keyid = '3B1802F81B321347'
00120         self.key = '''
00121 -----BEGIN PGP PUBLIC KEY BLOCK-----
00122 Version: GnuPG v1.4.10 (GNU/Linux)
00123 
00124 mI0ETY8gwwEEAMrSXBIJseIv9miuwnYlCd7CQCzNb8nHYkpo4o1nEQD3k/h7xj9m
00125 /0Gd5kLfF+WLwAxSJYb41JjaKs0FeUexSGNePdNFxn2CCZ4moHH19tTlWGfqCNz7
00126 vcYQpSbPix+zhR7uNqilxtsIrx1iyYwh7L2VKf/KMJ7yXbT+jbAj7fqBABEBAAG0
00127 CFRlc3QgS2V5iLgEEwECACIFAk2PIMMCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4B
00128 AheAAAoJEDsYAvgbMhNHlEED/1UkiLJ8R3phMRnjLtn+5JobYvOi7WEubnRv1rnN
00129 MC4MyhFiLux7Z8p3xwt1Pf2GqL7q1dD91NOx+6KS3d1PFmiM/i1fYalZPbzm1gNr
00130 8sFK2Gxsnd7mmYf2wKIo335Bk21SCmGcNKvmKW2M6ckzPT0q/RZ2hhY9JhHUiLG4
00131 Lu3muI0ETY8gwwEEAMQoiBCQYky52pDamnH5c7FngCM72AkNq/z0+DHqY202gksd
00132 Vy63TF7UGIsiCLvY787vPm62sOqYO0uI6PV5xVDGyJh4oI/g2zgNkhXRZrIB1Q+T
00133 THp7qSmwQUZv8T+HfgxLiaXDq6oV/HWLElcMQ9ClZ3Sxzlu3ZQHrtmY5XridABEB
00134 AAGInwQYAQIACQUCTY8gwwIbDAAKCRA7GAL4GzITR4hgBAClEurTj5n0/21pWZH0
00135 Ljmokwa3FM++OZxO7shc1LIVNiAKfLiPigU+XbvSeVWTeajKkvj5LCVxKQiRSiYB
00136 Z85TYTo06kHvDCYQmFOSGrLsZxMyJCfHML5spF9+bej5cepmuNVIdJK5vlgDiVr3
00137 uWUO7gMi+AlnxbfXVCTEgw3xhg==
00138 =j+6W
00139 -----END PGP PUBLIC KEY BLOCK-----
00140 '''

Definition at line 149 of file encryption_tests.py.

00149 
00150     def test_adds_key(self):
00151         self.keyring.add(self.key)
00152         self.assertEqual(self.keyring.keyids(), [self.keyid])
00153         self.assert_(self.keyid in self.keyring)
        

Definition at line 159 of file encryption_tests.py.

00159 
00160     def test_export_import_roundtrip_works(self):
00161         self.keyring.add(self.key)
00162         exported = str(self.keyring)
00163         keyring2 = obnamlib.Keyring(exported)
00164         self.assertEqual(keyring2.keyids(), [self.keyid])
00165 

Definition at line 145 of file encryption_tests.py.

00145 
00146     def test_gets_no_keys_from_empty_encoded(self):
00147         keyring = obnamlib.Keyring(encoded='')
00148         self.assertEqual(keyring.keyids(), [])
        

Definition at line 141 of file encryption_tests.py.

00141 
00142     def test_has_no_keys_initially(self):
00143         self.assertEqual(self.keyring.keyids(), [])
00144         self.assertEqual(str(self.keyring), '')

Definition at line 154 of file encryption_tests.py.

00154 
00155     def test_removes_key(self):
00156         self.keyring.add(self.key)
00157         self.keyring.remove(self.keyid)
00158         self.assertEqual(self.keyring.keyids(), [])
        

Member Data Documentation

Definition at line 119 of file encryption_tests.py.

Definition at line 118 of file encryption_tests.py.

Definition at line 117 of file encryption_tests.py.


The documentation for this class was generated from the following file: