File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -113,16 +113,17 @@ def __init__(
113
113
# or local metadata exists already (after "sigstore trust-instance")
114
114
root_json = bootstrap_root .read_bytes () if bootstrap_root else None
115
115
116
- self ._updater = Updater (
117
- metadata_dir = str (self ._metadata_dir ),
118
- metadata_base_url = url ,
119
- target_base_url = parse .urljoin (f"{ url } /" , "targets/" ),
120
- target_dir = str (self ._targets_dir ),
121
- config = UpdaterConfig (app_user_agent = f"sigstore-python/{ __version__ } " ),
122
- bootstrap = root_json ,
123
- )
124
-
125
116
try :
117
+ self ._updater = Updater (
118
+ metadata_dir = str (self ._metadata_dir ),
119
+ metadata_base_url = url ,
120
+ target_base_url = parse .urljoin (f"{ url } /" , "targets/" ),
121
+ target_dir = str (self ._targets_dir ),
122
+ config = UpdaterConfig (
123
+ app_user_agent = f"sigstore-python/{ __version__ } "
124
+ ),
125
+ bootstrap = root_json ,
126
+ )
126
127
self ._updater .refresh ()
127
128
except Exception as e :
128
129
raise TUFError ("Failed to refresh TUF metadata" ) from e
Original file line number Diff line number Diff line change 33
33
KeyringPurpose ,
34
34
)
35
35
from sigstore ._utils import is_timerange_valid
36
- from sigstore .errors import Error
36
+ from sigstore .errors import Error , TUFError
37
37
from sigstore .models import (
38
38
ClientTrustConfig ,
39
39
SigningConfig ,
@@ -294,9 +294,8 @@ def range_from(offset_lower=0, offset_upper=0):
294
294
295
295
296
296
def test_trust_root_tuf_instance_error ():
297
- # Expect file not found since embedded root.json is not found and
298
- # no local metadata is found
299
- with pytest .raises (FileNotFoundError ):
297
+ # embedded root.json is not found and no local metadata is found
298
+ with pytest .raises (TUFError ):
300
299
ClientTrustConfig .from_tuf ("foo.bar" )
301
300
302
301
You can’t perform that action at this time.
0 commit comments