@@ -855,42 +855,6 @@ def test_large(self):
855
855
}
856
856
)
857
857
858
- assert meta .as_json () == {
859
- "author" : "Example!" ,
860
- "author_email" :
"Unknown <[email protected] >" ,
861
- "classifier" : [
862
- "Development Status :: 4 - Beta" ,
863
- "Programming Language :: Python" ,
864
- ],
865
- "description" : "some readme 👋\n " ,
866
- "description_content_type" : "text/markdown" ,
867
- "keywords" : ["trampolim" , "is" , "interesting" ],
868
- "license" : "some license text" ,
869
- "maintainer_email" :
"Other Example <[email protected] >" ,
870
- "metadata_version" : "2.1" ,
871
- "name" : "full_metadata" ,
872
- "project_url" : [
873
- "homepage, example.com" ,
874
- "documentation, readthedocs.org" ,
875
- "repository, github.com/some/repo" ,
876
- "changelog, github.com/some/repo/blob/master/CHANGELOG.rst" ,
877
- ],
878
- "provides_extra" : ["test" ],
879
- "requires_dist" : [
880
- "dependency1" ,
881
- "dependency2>1.0.0" ,
882
- "dependency3[extra]" ,
883
- 'dependency4; os_name != "nt"' ,
884
- 'dependency5[other-extra]>1.0; os_name == "nt"' ,
885
- 'test_dependency; extra == "test"' ,
886
- 'test_dependency[test_extra]; extra == "test"' ,
887
- 'test_dependency[test_extra2]>3.0; os_name == "nt" and extra == "test"' ,
888
- ],
889
- "requires_python" : ">=3.8" ,
890
- "summary" : "A package with all the metadata :)" ,
891
- "version" : "3.2.1" ,
892
- }
893
-
894
858
core_metadata = meta .as_rfc822 ()
895
859
assert core_metadata .items () == [
896
860
("metadata-version" , "2.1" ),
@@ -928,3 +892,26 @@ def test_large(self):
928
892
]
929
893
930
894
assert core_metadata .get_payload () == "some readme 👋\n "
895
+
896
+ def test_modern_license (self ):
897
+ meta = metadata .Metadata .from_raw (
898
+ {
899
+ "metadata_version" : "2.4" ,
900
+ "name" : "full_metadata" ,
901
+ "version" : "3.2.1" ,
902
+ "license_expression" : "MIT" ,
903
+ "license_files" : ["LICENSE.txt" , "LICENSE" ],
904
+ }
905
+ )
906
+
907
+ core_metadata = meta .as_rfc822 ()
908
+ assert core_metadata .items () == [
909
+ ("metadata-version" , "2.4" ),
910
+ ("name" , "full_metadata" ),
911
+ ("version" , "3.2.1" ),
912
+ ("license-expression" , "MIT" ),
913
+ ("license-file" , "LICENSE.txt" ),
914
+ ("license-file" , "LICENSE" ),
915
+ ]
916
+
917
+ assert core_metadata .get_payload () is None
0 commit comments