File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 3
3
import os
4
4
import shutil
5
5
import time
6
+ from pathlib import Path
6
7
7
8
import pytest
8
9
import requests
@@ -493,6 +494,23 @@ def test_local_jwk():
493
494
assert kb
494
495
495
496
497
+ def test_local_jwk_update ():
498
+ cache_time = 0.1
499
+ _path = full_path ('jwk_private_key.json' )
500
+ kb = KeyBundle (source = 'file://{}' .format (_path ), cache_time = cache_time )
501
+ assert kb
502
+ _ = kb .keys ()
503
+ last1 = kb .last_local
504
+ _ = kb .keys ()
505
+ last2 = kb .last_local
506
+ assert last1 == last2 # file not changed
507
+ time .sleep (cache_time + 0.1 )
508
+ Path (_path ).touch ()
509
+ _ = kb .keys ()
510
+ last3 = kb .last_local
511
+ assert last2 != last3 # file changed
512
+
513
+
496
514
def test_local_jwk_copy ():
497
515
_path = full_path ('jwk_private_key.json' )
498
516
kb = KeyBundle (source = 'file://{}' .format (_path ))
You can’t perform that action at this time.
0 commit comments