@@ -108,21 +108,26 @@ def test_pull_through_install(self):
108108 remote = self ._create_remote (url = PYPI_URL )
109109 distro = self ._create_distribution (remote = remote .pulp_href )
110110
111- if self .cli_client .run (("pip" , "list" )).stdout .find ("numpy" ) == - 1 :
112- content = self .content_api .list (name = "numpy" )
113- self .assertEqual (content .count , 0 , msg = "numpy content already present in test" )
111+ PACKAGE = "sampleproject"
112+ if self .cli_client .run (("pip" , "list" )).stdout .find (PACKAGE ) == - 1 :
113+ content = self .content_api .list (name = PACKAGE )
114+ self .assertEqual (
115+ content .count , 0 , msg = f"{ PACKAGE } content already present in test"
116+ )
114117 host = urlsplit (PULP_CONTENT_BASE_URL ).hostname
115118 url = urljoin (self .PYPI_HOST , f"{ distro .base_path } /simple/" )
116119 out = self .cli_client .run (
117- ("pip" , "install" , "--trusted-host" , host , "-i" , url , "numpy" )
120+ ("pip" , "install" , "--trusted-host" , host , "-i" , url , PACKAGE )
118121 )
119122 self .addCleanup (delete_orphans )
120- self .assertTrue (self .cli_client .run (("pip" , "list" )).stdout .find ("numpy" ) != - 1 , out )
121- self .addCleanup (self .cli_client .run , ("pip" , "uninstall" , "numpy" , "-y" ))
122- content = self .content_api .list (name = "numpy" )
123+ self .assertTrue (
124+ self .cli_client .run (("pip" , "list" )).stdout .find (PACKAGE ) != - 1 , out
125+ )
126+ self .addCleanup (self .cli_client .run , ("pip" , "uninstall" , PACKAGE , "-y" ))
127+ content = self .content_api .list (name = PACKAGE )
123128 self .assertEqual (content .count , 1 )
124129 else :
125- self .skipTest ("Uninstall numpy before running this test" )
130+ self .skipTest (f "Uninstall { PACKAGE } before running this test" )
126131
127132 def test_pull_through_simple (self ):
128133 """Tests that the simple page is properly modified when requesting a pull-through."""
0 commit comments