Skip to content

Commit 88dab8b

Browse files
committed
Address linting
1 parent f5d3922 commit 88dab8b

26 files changed

Lines changed: 2101 additions & 2093 deletions

terminusdb_client/tests/integration_tests/test_schema.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -140,23 +140,23 @@ def test_getting_and_deleting_cheuk(schema_test_db):
140140
assert "cheuk" not in globals()
141141
assert "cheuk" not in locals()
142142
client.connect(db=db_name)
143-
143+
144144
# Set up: Create test data first
145145
Country = test_schema.object.get("Country")
146146
Address = test_schema.object.get("Address")
147147
Employee = test_schema.object.get("Employee")
148148
Role = test_schema.object.get("Role")
149149
Team = test_schema.object.get("Team")
150-
150+
151151
uk = Country()
152152
uk.name = "UK Test 1"
153153
uk.perimeter = []
154-
154+
155155
home = Address()
156156
home.street = "123 Abc Street"
157157
home.country = uk
158158
home.postal_code = "A12 345"
159-
159+
160160
cheuk_setup = Employee()
161161
cheuk_setup.permisstion = {Role.Admin, Role.Read}
162162
cheuk_setup.address_of = home
@@ -167,9 +167,9 @@ def test_getting_and_deleting_cheuk(schema_test_db):
167167
cheuk_setup.managed_by = cheuk_setup
168168
cheuk_setup.friend_of = {cheuk_setup}
169169
cheuk_setup.member_of = Team.IT
170-
170+
171171
client.insert_document([cheuk_setup], commit_msg="Setup for test_getting_and_deleting_cheuk")
172-
172+
173173
# Test: Load and verify
174174
new_schema = WOQLSchema()
175175
new_schema.from_db(client)
@@ -188,14 +188,14 @@ def test_getting_and_deleting_cheuk(schema_test_db):
188188
def test_insert_cheuk_again(schema_test_db):
189189
db_name, client, test_schema = schema_test_db
190190
client.connect(db=db_name)
191-
191+
192192
# Set up: Create Country first
193193
Country = test_schema.object.get("Country")
194194
uk_setup = Country()
195195
uk_setup.name = "UK Test 2"
196196
uk_setup.perimeter = []
197197
client.insert_document([uk_setup], commit_msg="Setup country for test_insert_cheuk_again")
198-
198+
199199
# Test: Load country and create employee
200200
new_schema = WOQLSchema()
201201
new_schema.from_db(client)
@@ -243,7 +243,7 @@ def test_insert_cheuk_again(schema_test_db):
243243
found_country = False
244244
found_employee = False
245245
found_coordinate = False
246-
246+
247247
for item in result:
248248
if item.get("@type") == "Country" and item.get("name") == "UK Test 2":
249249
assert item["perimeter"]
@@ -259,7 +259,7 @@ def test_insert_cheuk_again(schema_test_db):
259259
elif item.get("@type") == "Coordinate" and item.get("x") == -0.7:
260260
assert item["y"] == 51.3
261261
found_coordinate = True
262-
262+
263263
assert found_country, "UK Test 2 country not found"
264264
assert found_employee, "cheuk_test_2 employee not found"
265265
assert found_coordinate, "Coordinate not found"
@@ -268,27 +268,27 @@ def test_insert_cheuk_again(schema_test_db):
268268
def test_get_data_version(schema_test_db):
269269
db_name, client, test_schema = schema_test_db
270270
client.connect(db=db_name)
271-
271+
272272
# Set up: Create test employee for data version tests
273273
Country = test_schema.object.get("Country")
274274
Address = test_schema.object.get("Address")
275275
Employee = test_schema.object.get("Employee")
276276
Role = test_schema.object.get("Role")
277277
Team = test_schema.object.get("Team")
278278
Coordinate = test_schema.object.get("Coordinate")
279-
279+
280280
uk = Country()
281281
uk.name = "UK Test 3"
282282
uk.perimeter = []
283-
283+
284284
home = Address()
285285
home.street = "123 Abc Street"
286286
home.country = uk
287287
home.postal_code = "A12 345"
288-
288+
289289
location = Coordinate(x=0.7, y=51.3)
290290
uk.perimeter = [location]
291-
291+
292292
cheuk = Employee()
293293
cheuk.permisstion = {Role.Admin, Role.Read}
294294
cheuk.address_of = home
@@ -299,7 +299,7 @@ def test_get_data_version(schema_test_db):
299299
cheuk.friend_of = {cheuk}
300300
cheuk.member_of = Team.IT
301301
cheuk._id = "cheuk_test_3"
302-
302+
303303
client.insert_document([location, uk, cheuk], commit_msg="Setup for test_get_data_version")
304304
result, version = client.get_all_branches(get_data_version=True)
305305
assert version

terminusdb_client/tests/test_errors.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,12 @@ def test_error_inheritance_chain():
236236

237237
class TestAPIError:
238238
"""Test APIError class functionality"""
239-
239+
240240
def test_api_error_initialization(self):
241241
"""Test APIError can be initialized with all parameters"""
242242
# Test the specific lines that need coverage (116-120)
243243
# These lines are in the APIError.__init__ method
244-
244+
245245
# We need to mock the parent constructor to avoid the response issue
246246
with patch.object(DatabaseError, '__init__', return_value=None):
247247
# Now we can create APIError normally
@@ -251,32 +251,32 @@ def test_api_error_initialization(self):
251251
status_code=400,
252252
url="https://example.com/api"
253253
)
254-
254+
255255
# Verify the attributes were set (lines 117-120)
256256
assert api_error.message == "Test error message"
257257
assert api_error.error_obj == {"error": "details"}
258258
assert api_error.status_code == 400
259259
assert api_error.url == "https://example.com/api"
260-
260+
261261
def test_api_error_inheritance(self):
262262
"""Test APIError inherits from DatabaseError"""
263263
# Create without constructor to avoid issues
264264
api_error = APIError.__new__(APIError)
265-
265+
266266
assert isinstance(api_error, DatabaseError)
267267
assert isinstance(api_error, Error)
268268
assert isinstance(api_error, Exception)
269-
269+
270270
def test_api_error_str_representation(self):
271271
"""Test APIError string representation"""
272272
# Create without constructor to avoid issues
273273
api_error = APIError.__new__(APIError)
274274
api_error.message = "Test message"
275-
275+
276276
str_repr = str(api_error)
277-
277+
278278
assert "Test message" in str_repr
279-
279+
280280
def test_api_error_with_minimal_params(self):
281281
"""Test APIError with minimal parameters"""
282282
# Mock the parent constructor to avoid the response issue
@@ -288,7 +288,7 @@ def test_api_error_with_minimal_params(self):
288288
status_code=None,
289289
url=None
290290
)
291-
291+
292292
assert api_error.message is None
293293
assert api_error.error_obj is None
294294
assert api_error.status_code is None

0 commit comments

Comments
 (0)