@@ -1981,15 +1981,13 @@ def test_show_required_by_deps(
1981
1981
assert actual == expected
1982
1982
1983
1983
1984
- def test_show_entire_description_with_no_truncate (
1985
- tester : CommandTester , poetry : Poetry , installed : Repository
1984
+ @pytest .mark .parametrize ("truncate" , [False , True ])
1985
+ def test_show_entire_description_truncate (
1986
+ tester : CommandTester , poetry : Poetry , installed : Repository , truncate : str
1986
1987
) -> None :
1987
1988
poetry .package .add_dependency (Factory .create_dependency ("cachy" , "^0.2.0" ))
1988
1989
1989
1990
cachy2 = get_package ("cachy" , "0.2.0" )
1990
- cachy2 .description = (
1991
- "This is a veeeeeeeery long description that should not be truncated."
1992
- )
1993
1991
cachy2 .add_dependency (Factory .create_dependency ("msgpack-python" , ">=0.5 <0.6" ))
1994
1992
1995
1993
installed .add_package (cachy2 )
@@ -2001,7 +1999,7 @@ def test_show_entire_description_with_no_truncate(
2001
1999
{
2002
2000
"name" : "cachy" ,
2003
2001
"version" : "0.2.0" ,
2004
- "description" : "This is a veeeeeeeery long description that should not be truncated." ,
2002
+ "description" : "This is a veeeeeeeery long description that might be truncated." ,
2005
2003
"category" : "main" ,
2006
2004
"optional" : False ,
2007
2005
"platform" : "*" ,
@@ -2029,67 +2027,15 @@ def test_show_entire_description_with_no_truncate(
2029
2027
}
2030
2028
)
2031
2029
2032
- tester .execute ("--no-truncate" )
2030
+ tester .execute ("" if truncate else " --no-truncate" )
2033
2031
2034
- expected = """\
2035
- cachy 0.2.0 This is a veeeeeeeery long description that should not be truncated.
2032
+ if truncate :
2033
+ expected = """\
2034
+ cachy 0.2.0 This is a veeeeeeeery long description that might ...
2036
2035
msgpack-python (!) 0.5.1"""
2037
-
2038
- assert tester .io .fetch_output ().strip () == expected
2039
-
2040
-
2041
- def test_show_entire_description_with_truncate (
2042
- tester : CommandTester , poetry : Poetry , installed : Repository
2043
- ) -> None :
2044
- poetry .package .add_dependency (Factory .create_dependency ("cachy" , "^0.2.0" ))
2045
-
2046
- cachy2 = get_package ("cachy" , "0.2.0" )
2047
- cachy2 .description = (
2048
- "This is a veeeeeeeery long description that should be truncated."
2049
- )
2050
- cachy2 .add_dependency (Factory .create_dependency ("msgpack-python" , ">=0.5 <0.6" ))
2051
-
2052
- installed .add_package (cachy2 )
2053
-
2054
- assert isinstance (poetry .locker , TestLocker )
2055
- poetry .locker .mock_lock_data (
2056
- {
2057
- "package" : [
2058
- {
2059
- "name" : "cachy" ,
2060
- "version" : "0.2.0" ,
2061
- "description" : "This is a veeeeeeeery long description that should be truncated." ,
2062
- "category" : "main" ,
2063
- "optional" : False ,
2064
- "platform" : "*" ,
2065
- "python-versions" : "*" ,
2066
- "checksum" : [],
2067
- "dependencies" : {"msgpack-python" : ">=0.5 <0.6" },
2068
- },
2069
- {
2070
- "name" : "msgpack-python" ,
2071
- "version" : "0.5.1" ,
2072
- "description" : "" ,
2073
- "category" : "main" ,
2074
- "optional" : False ,
2075
- "platform" : "*" ,
2076
- "python-versions" : "*" ,
2077
- "checksum" : [],
2078
- },
2079
- ],
2080
- "metadata" : {
2081
- "python-versions" : "*" ,
2082
- "platform" : "*" ,
2083
- "content-hash" : "123456789" ,
2084
- "files" : {"cachy" : [], "msgpack-python" : []},
2085
- },
2086
- }
2087
- )
2088
-
2089
- tester .execute ()
2090
-
2091
- expected = """\
2092
- cachy 0.2.0 This is a veeeeeeeery long description that should...
2036
+ else :
2037
+ expected = """\
2038
+ cachy 0.2.0 This is a veeeeeeeery long description that might be truncated.
2093
2039
msgpack-python (!) 0.5.1"""
2094
2040
2095
2041
assert tester .io .fetch_output ().strip () == expected
0 commit comments