@@ -24,27 +24,45 @@ def _test_no_simple_api_sources(env):
2424 "foo==0.0.1" : struct (
2525 requirement = "foo==0.0.1" ,
2626 marker = "" ,
27+ url = "" ,
28+ filename = "" ,
2729 ),
2830 "foo==0.0.1 @ https://someurl.org" : struct (
2931 requirement = "foo==0.0.1 @ https://someurl.org" ,
3032 marker = "" ,
33+ url = "https://someurl.org" ,
34+ filename = "someurl.org" ,
3135 ),
32- "foo==0.0.1 @ https://someurl.org --hash=sha256:deadbeef " : struct (
33- requirement = "foo==0.0.1 @ https://someurl.org --hash=sha256:deadbeef " ,
36+ "foo==0.0.1 @ https://someurl.org/package.whl " : struct (
37+ requirement = "foo==0.0.1 @ https://someurl.org/package.whl " ,
3438 marker = "" ,
39+ url = "https://someurl.org/package.whl" ,
40+ filename = "package.whl" ,
3541 ),
36- "foo==0.0.1 @ https://someurl.org; python_version < \" 2.7\" \\ --hash=sha256:deadbeef" : struct (
37- requirement = "foo==0.0.1 @ https://someurl.org --hash=sha256:deadbeef" ,
42+ "foo==0.0.1 @ https://someurl.org/package.whl --hash=sha256:deadbeef" : struct (
43+ requirement = "foo==0.0.1 @ https://someurl.org/package.whl --hash=sha256:deadbeef" ,
44+ marker = "" ,
45+ url = "https://someurl.org/package.whl" ,
46+ filename = "package.whl" ,
47+ shas = ["deadbeef" ],
48+ ),
49+ "foo==0.0.1 @ https://someurl.org/package.whl; python_version < \" 2.7\" \\ --hash=sha256:deadbeef" : struct (
50+ requirement = "foo==0.0.1 @ https://someurl.org/package.whl --hash=sha256:deadbeef" ,
3851 marker = "python_version < \" 2.7\" " ,
52+ url = "https://someurl.org/package.whl" ,
53+ filename = "package.whl" ,
54+ shas = ["deadbeef" ],
3955 ),
4056 }
4157 for input , want in inputs .items ():
4258 got = index_sources (input )
43- env .expect .that_collection (got .shas ).contains_exactly ([])
59+ env .expect .that_collection (got .shas ).contains_exactly (want . shas if hasattr ( want , "shas" ) else [])
4460 env .expect .that_str (got .version ).equals ("0.0.1" )
4561 env .expect .that_str (got .requirement ).equals (want .requirement )
4662 env .expect .that_str (got .requirement_line ).equals (got .requirement )
4763 env .expect .that_str (got .marker ).equals (want .marker )
64+ env .expect .that_str (got .url ).equals (want .url )
65+ env .expect .that_str (got .filename ).equals (want .filename )
4866
4967_tests .append (_test_no_simple_api_sources )
5068
0 commit comments