Example #1
0
 def test_encryptJ(self):
     context = fialka.application_context(['-e', '-w', '0', 'A', 'J'])
     encrypted = fialka.code(context, 'A', 'J')
     self.assertEqual(encrypted, 'F')
Example #2
0
 def test_encryptA(self):
     context = fialka.application_context(['-e', '-w', '0', 'A', 'A'])
     self.assertEqual(len(context['rotor']), 1)
     encrypted = fialka.code(context, 'A', 'A')
     self.assertEqual(encrypted, '7')
Example #3
0
 def setUp(self):
     self.context = fialka.application_context(
         ['-e', 'ABCDEFGH1J', '1GN0REME'])
Example #4
0
 def test_application_context5(self):
     with self.assertRaises(ArgumentError):
         ctxt = fialka.application_context(['ABCDEFGH1J', 'TEST1NG123'])
Example #5
0
 def test_sanity_check2(self):
     with self.assertRaises(ValueError):
         ctxt = fialka.application_context(['-e', 'ABCDEFGHIJ', 'FA1L'])
Example #6
0
 def test_sanity_check1(self):
     ctxt = fialka.application_context(['-e', 'ABCDEFGH1J', '1GN0REME'])
     ctxt['args'].key = 'LO0KIEHERE'
     with self.assertRaises(ValueError):
         fialka.sanity_check(ctxt)