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