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 33import os
44import shutil
55import time
6+ from pathlib import Path
67
78import pytest
89import requests
@@ -493,6 +494,23 @@ def test_local_jwk():
493494 assert kb
494495
495496
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+
496514def test_local_jwk_copy ():
497515 _path = full_path ('jwk_private_key.json' )
498516 kb = KeyBundle (source = 'file://{}' .format (_path ))
You can’t perform that action at this time.
0 commit comments