File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11from jwt .compat import constant_time_compare
22
33from .compat import unittest
4+ from .utils import ensure_bytes
45
56
67class TestCompat (unittest .TestCase ):
78 def setUp (self ): # noqa
89 pass
910
1011 def test_constant_time_compare_returns_true_if_same (self ):
11- self .assertTrue (constant_time_compare ('abc' , 'abc' ))
12+ self .assertTrue (constant_time_compare (
13+ ensure_bytes ('abc' ), ensure_bytes ('abc' )
14+ ))
1215
1316 def test_constant_time_compare_returns_false_if_diff_lengths (self ):
14- self .assertFalse (constant_time_compare ('abc' , 'abcd' ))
17+ self .assertFalse (constant_time_compare (
18+ ensure_bytes ('abc' ), ensure_bytes ('abcd' )
19+ ))
1520
1621 def test_constant_time_compare_returns_false_if_totally_different (self ):
17- self .assertFalse (constant_time_compare ('abcd' , 'efgh' ))
22+ self .assertFalse (constant_time_compare (
23+ ensure_bytes ('abcd' ), ensure_bytes ('efgh' )
24+ ))
You can’t perform that action at this time.
0 commit comments