MCPcopy
hub / github.com/pex-tool/pex / test_parse_nominal

Function test_parse_nominal

tests/test_pep_723.py:105–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104
105def test_parse_nominal():
106 # type: () -> None
107
108 assert ScriptMetadata(
109 dependencies=tuple([parse_requirement_string("ansicolors")])
110 ) == ScriptMetadata.parse(
111 dedent(
112 """
113 # /// script
114 # dependencies = ["ansicolors"]
115 # ///
116 """
117 )
118 )
119
120 assert ScriptMetadata(requires_python=specifiers.SpecifierSet("~=3.8")) == ScriptMetadata.parse(
121 dedent(
122 """
123 # /// script
124 # requires-python = "~=3.8"
125 # ///
126 """
127 )
128 )
129
130 assert ScriptMetadata(
131 dependencies=tuple([parse_requirement_string("cowsay<6")]),
132 requires_python=specifiers.SpecifierSet("==2.7.*"),
133 ) == ScriptMetadata.parse(
134 dedent(
135 """
136 dependencies = ["before"]
137 # /// script
138 # dependencies = [
139 # "cowsay<6",
140 # ]
141 #
142 # # Yup, 2.7.
143 # requires-python = "==2.7.*"
144 #
145 # not-a-recognized-key = 42
146 # ///
147 dependencies = ["after"]
148 """
149 )
150 )
151
152
153def test_parse_invalid_embedded_start():

Callers

nothing calls this directly

Calls 3

ScriptMetadataClass · 0.90
parse_requirement_stringFunction · 0.90
parseMethod · 0.45

Tested by

no test coverage detected