예제 #1
0
파일: tests.py 프로젝트: bfauth/bfa_python
 def test_salted_fp_len(self):
     self.request.POST = {'fp': self.fp}
     fp_len = len(get(self.request, use_salt=True)['fp'])
     self.assertEqual(fp_len, 64)
예제 #2
0
파일: tests.py 프로젝트: bfauth/bfa_python
 def test_good_fingerprint(self):
     self.request.POST = {'fp': self.fp}
     self.assertEqual(get(self.request), self.fp)
예제 #3
0
파일: tests.py 프로젝트: bfauth/bfa_python
 def test_missing_fingerprint_field(self):
     with self.assertRaises(TemplateSyntaxError):
         get(self.request)
예제 #4
0
파일: tests.py 프로젝트: bfauth/bfa_python
 def test_wrong_fingerprint_length(self):
     self.request.POST = {'fp': 'qwerty'}
     with self.assertRaises(ValueError):
         get(self.request)
예제 #5
0
파일: tests.py 프로젝트: bfauth/bfa_python
 def test_empty_fingerprint(self):
     self.request.POST = {'fp': ''}
     with self.assertRaises(ConnectionError):
         get(self.request)
예제 #6
0
파일: tests.py 프로젝트: bfauth/bfa_python
 def test_wrong_argument(self):
     with self.assertRaises(TypeError):
         get(dict)