~ubuntu-branches/ubuntu/precise/mailcrypt/precise

« back to all changes in this revision

Viewing changes to tests/make_gpg_testcases.py

  • Committer: Bazaar Package Importer
  • Author(s): Davide G. M. Salvetti
  • Date: 2007-01-28 12:08:23 UTC
  • mfrom: (2.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20070128120823-344fs3vl88wzbpya
Tags: 3.5.8+CVS.2005.04.29.1-10
* po/cs.po: New file; thanks to Martin Šín.  (Closes: #382926)
* po/de.po: Updated file; thanks to Helge Kreutzmann.  (Closes: #407728)

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
        self.encrypted_fields(recip)
204
204
    def make_crypttext(self):
205
205
        self.d['crypttext'] = "\n" + encrypt(self.recip, self.plaintext)
206
 
        
 
206
 
 
207
class Latin1_E_Case(E_Case):
 
208
    # encrypt a message that contains ISO-Latin-1 characters
 
209
    def make_plaintext(self):
 
210
        return """
 
211
Usted tiene que mostrar esta evidencia escrita a un oficial de polic�a cuando
 
212
�ste lo solicite as� como a otro conductor o due�o do propiedad despu�s de un
 
213
accidente vial."""
 
214
 
 
215
class EE_Case(E_Case):
 
216
    # encrypt to multiple recipients, some unknown
 
217
    def make_crypttext(self):
 
218
        self.d['crypttext'] = "\n" + \
 
219
                              encryptor.encrypt_string(self.plaintext,
 
220
                                                       ["unknown",
 
221
                                                        "other",
 
222
                                                        self.recip])
207
223
class ES_Case(TestCase):
208
224
    def __init__(self, filename, recip, signer):
209
225
        TestCase.__init__(self, filename)
232
248
    def make_crypttext(self):
233
249
        self.d['crypttext'] = "\n" + clearsign(self.signer, self.plaintext)
234
250
 
 
251
class Latin1_CS_Case(CS_Case):
 
252
    def make_plaintext(self):
 
253
        return """
 
254
Usted tiene que mostrar esta evidencia escrita a un oficial de polic�a cuando
 
255
�ste lo solicite as� como a otro conductor o due�o do propiedad despu�s de un
 
256
accidente vial.
 
257
"""
 
258
    
235
259
class SYM_Case(TestCase):
236
260
    def __init__(self, filename, passphrase):
237
261
        TestCase.__init__(self, filename)
261
285
    CS_Case("CS.s2v", "trusted").process(d)
262
286
    CS_Case("CS.s3v", "untrusted").process(d)
263
287
    CS_Case("CS.s4", "unknown").process(d)
 
288
    Latin1_CS_Case("CS.latin1.s1v", "owner1").process(d)
 
289
    Latin1_E_Case("E.latin1.e1r", "owner1").process(d)
 
290
    EE_Case("E.e1re3re4r", "owner1").process(d)
264
291
 
265
292
# get keyids
266
293
id = {}