Exemple #1
0
 def test_randnum_min(self):
     passp = Passphrase()
     for wrongtype in constants.WRONGTYPES_INT:
         with self.assertRaises(TypeError) as context:
             passp.randnum_min = wrongtype
         self.assertIn('randnum_min can only be int',
                       str(context.exception))
     with self.assertRaises(ValueError) as context:
         passp.randnum_min = -1
     self.assertIn('randnum_min should be greater than 0',
                   str(context.exception))
Exemple #2
0
 def test_randnum_min(self):
     passp = Passphrase()
     passp.randnum_min = 1
     self.assertEqual(passp.randnum_min, 1)