@@ -91,9 +91,11 @@ def test_list_projects_integration(integration_client):
9191
9292 if project_list :
9393 project = project_list [0 ]
94- assert hasattr (project , 'id' ), "Project should have an ID"
95- assert hasattr (project , 'name' ), "Project should have a name"
96- assert hasattr (project , 'organization' ), "Project should have an organization"
94+ assert hasattr (project , "id" ), "Project should have an ID"
95+ assert hasattr (project , "name" ), "Project should have a name"
96+ assert hasattr (project , "organization" ), (
97+ "Project should have an organization"
98+ )
9799 print (f"📋 Example project: { project .name } (ID: { project .id } )" )
98100 else :
99101 print ("📋 No projects found - this is normal for a new organization" )
@@ -123,9 +125,15 @@ def test_project_crud_integration(integration_client):
123125 print (f"🔨 Creating project: { test_name } " )
124126 created_project = projects .create (org , test_name )
125127
126- assert created_project .name == test_name , f"Expected name { test_name } , got { created_project .name } "
127- assert created_project .organization == org , f"Expected org { org } , got { created_project .organization } "
128- assert created_project .id .startswith ("prj-" ), f"Project ID should start with 'prj-', got { created_project .id } "
128+ assert created_project .name == test_name , (
129+ f"Expected name { test_name } , got { created_project .name } "
130+ )
131+ assert created_project .organization == org , (
132+ f"Expected org { org } , got { created_project .organization } "
133+ )
134+ assert created_project .id .startswith ("prj-" ), (
135+ f"Project ID should start with 'prj-', got { created_project .id } "
136+ )
129137
130138 project_id = created_project .id
131139 print (f"✅ Created project: { project_id } " )
@@ -134,16 +142,24 @@ def test_project_crud_integration(integration_client):
134142 print (f"📖 Reading project: { project_id } " )
135143 read_project = projects .read (project_id )
136144
137- assert read_project .id == project_id , f"Expected ID { project_id } , got { read_project .id } "
138- assert read_project .name == test_name , f"Expected name { test_name } , got { read_project .name } "
145+ assert read_project .id == project_id , (
146+ f"Expected ID { project_id } , got { read_project .id } "
147+ )
148+ assert read_project .name == test_name , (
149+ f"Expected name { test_name } , got { read_project .name } "
150+ )
139151 print (f"✅ Successfully read project: { read_project .name } " )
140152
141153 # UPDATE - Test updating the project name
142154 print (f"✏️ Updating project name to: { updated_name } " )
143155 updated_project = projects .update (project_id , updated_name )
144156
145- assert updated_project .id == project_id , f"Project ID should remain { project_id } "
146- assert updated_project .name == updated_name , f"Expected updated name { updated_name } , got { updated_project .name } "
157+ assert updated_project .id == project_id , (
158+ f"Project ID should remain { project_id } "
159+ )
160+ assert updated_project .name == updated_name , (
161+ f"Expected updated name { updated_name } , got { updated_project .name } "
162+ )
147163 print (f"✅ Successfully updated project: { updated_project .name } " )
148164
149165 except Exception as e :
@@ -158,7 +174,9 @@ def test_project_crud_integration(integration_client):
158174 print ("✅ Test project deleted successfully" )
159175 except Exception as e :
160176 print (f"❌ Warning: Failed to clean up project { project_id } : { e } " )
161- print (" You may need to manually delete this project in HCP Terraform" )
177+ print (
178+ " You may need to manually delete this project in HCP Terraform"
179+ )
162180
163181
164182def test_error_handling_integration (integration_client ):
@@ -172,7 +190,9 @@ def test_error_handling_integration(integration_client):
172190 projects .read (fake_project_id )
173191 pytest .fail ("Should have raised an exception for non-existent project" )
174192 except Exception as e :
175- print (f"✅ Correctly handled error for non-existent project: { type (e ).__name__ } " )
193+ print (
194+ f"✅ Correctly handled error for non-existent project: { type (e ).__name__ } "
195+ )
176196 # This should raise a NotFound or similar error
177197 assert "not found" in str (e ).lower () or "404" in str (e )
178198
@@ -197,7 +217,9 @@ def test_error_handling_integration(integration_client):
197217 sys .exit (1 )
198218
199219 print ("🧪 Running integration tests directly..." )
200- print (" For full pytest features, use: pytest examples/integration_test_example.py -v -s" )
220+ print (
221+ " For full pytest features, use: pytest examples/integration_test_example.py -v -s"
222+ )
201223
202224 # Simple direct execution
203225 pytest .main ([__file__ , "-v" , "-s" ])
0 commit comments