@@ -145,7 +145,11 @@ def test_exc_with_missing_message(self, monkeypatch):
145
145
146
146
147
147
def test_construct_dependencies ():
148
- types = {"requires" : DependencyKind .requires , "provides" : DependencyKind .provides }
148
+ types = {
149
+ "requires" : DependencyKind .requires ,
150
+ "provides" : DependencyKind .provides ,
151
+ "requires_dist" : DependencyKind .requires_dist ,
152
+ }
149
153
150
154
meta = metadata .Metadata .from_raw (
151
155
{
@@ -3064,10 +3068,7 @@ def test_upload_succeeds_pep625_normalized_filename(
3064
3068
@pretend .call_recorder
3065
3069
def storage_service_store (path , file_path , * , meta ):
3066
3070
with open (file_path , "rb" ) as fp :
3067
- if file_path .endswith (".metadata" ):
3068
- assert fp .read () == b"Fake metadata"
3069
- else :
3070
- assert fp .read () == filebody
3071
+ assert fp .read () == filebody
3071
3072
3072
3073
storage_service = pretend .stub (store = storage_service_store )
3073
3074
@@ -5153,13 +5154,13 @@ def test_upload_succeeds_creates_release_metadata_2_4(
5153
5154
)
5154
5155
digest = _TAR_GZ_PKG_MD5
5155
5156
data = _TAR_GZ_PKG_TESTDATA
5156
- elif mimetype == "application/zip" :
5157
+ elif mimetype == "application/zip" : # pragma: no branch
5157
5158
filename = "{}-{}.zip" .format (
5158
5159
project .normalized_name .replace ("-" , "_" ), "1.0"
5159
5160
)
5160
5161
digest = _ZIP_PKG_MD5
5161
5162
data = _ZIP_PKG_TESTDATA
5162
- elif filetype == "bdist_wheel" :
5163
+ elif filetype == "bdist_wheel" : # pragma: no branch
5163
5164
filename = "{}-{}-py3-none-any.whl" .format (
5164
5165
project .normalized_name .replace ("-" , "_" ), "1.0"
5165
5166
)
@@ -5271,14 +5272,14 @@ def test_upload_fails_missing_license_file_metadata_2_4(
5271
5272
)
5272
5273
digest = _TAR_GZ_PKG_MD5
5273
5274
data = _TAR_GZ_PKG_TESTDATA
5274
- elif mimetype == "application/zip" :
5275
+ elif mimetype == "application/zip" : # pragma: no branch
5275
5276
filename = "{}-{}.zip" .format (
5276
5277
project .normalized_name .replace ("-" , "_" ), "1.0"
5277
5278
)
5278
5279
digest = _ZIP_PKG_MD5
5279
5280
data = _ZIP_PKG_TESTDATA
5280
5281
license_filename = "fake_package-1.0/LICENSE"
5281
- elif filetype == "bdist_wheel" :
5282
+ elif filetype == "bdist_wheel" : # pragma: no branch
5282
5283
filename = "{}-{}-py3-none-any.whl" .format (
5283
5284
project .normalized_name .replace ("-" , "_" ),
5284
5285
"1.0" ,
@@ -5475,22 +5476,6 @@ def test_upload_for_company_organization_owned_project_fails_without_subscriptio
5475
5476
name = project .normalized_name .replace ("-" , "_" ), version = version
5476
5477
)
5477
5478
5478
- @pretend .call_recorder
5479
- def storage_service_store (path , file_path , * , meta ):
5480
- with open (file_path , "rb" ) as fp :
5481
- if file_path .endswith (".metadata" ):
5482
- assert fp .read () == b"Fake metadata"
5483
- else :
5484
- assert fp .read () == filebody
5485
-
5486
- storage_service = pretend .stub (store = storage_service_store )
5487
-
5488
- db_request .find_service = pretend .call_recorder (
5489
- lambda svc , name = None , context = None : {
5490
- IFileStorage : storage_service ,
5491
- }.get (svc )
5492
- )
5493
-
5494
5479
monkeypatch .setattr (
5495
5480
legacy , "_is_valid_dist_file" , lambda * a , ** kw : (True , None )
5496
5481
)
0 commit comments