Skip to content

Commit

Permalink
PR #212: Fix merge conflict problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois-Werbrouck committed Nov 29, 2024
1 parent 4561ce4 commit 5bd9cc4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 72 deletions.
15 changes: 7 additions & 8 deletions tests/fertiscan/db/test_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,13 @@ def test_get_label_information(self):
self.assertEqual(label_data[1], self.product_name)
self.assertEqual(label_data[2], self.lot_number)
self.assertEqual(label_data[3], self.npk)
self.assertEqual(label_data[4], self.registration_number)
self.assertEqual(label_data[5], self.n)
self.assertEqual(label_data[6], self.p)
self.assertEqual(label_data[7], self.k)
self.assertEqual(label_data[8], self.guaranteed_analysis_title_en)
self.assertEqual(label_data[9], self.guaranteed_analysis_title_fr)
self.assertEqual(label_data[10], self.guaranteed_is_minimal)
self.assertIsNone(label_data[12])
self.assertEqual(label_data[4], self.n)
self.assertEqual(label_data[5], self.p)
self.assertEqual(label_data[6], self.k)
self.assertEqual(label_data[7], self.guaranteed_analysis_title_en)
self.assertEqual(label_data[8], self.guaranteed_analysis_title_fr)
self.assertEqual(label_data[9], self.guaranteed_is_minimal)
self.assertIsNone(label_data[10])

def test_get_label_information_json(self):
label_information_id = label.new_label_information(
Expand Down
28 changes: 0 additions & 28 deletions tests/fertiscan/db/update_inspection/test_update_guaranteed.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,6 @@ def setUp(self):
}
}

# Insert test data to obtain a valid label_id
sample_org_info = json.dumps(
{
"name": "Test Company",
"address": "123 Test Address",
"website": "http://www.testcompany.com",
"phone_number": "+1 800 555 0123",
}
)
self.cursor.execute("SELECT upsert_organization_info(%s);", (sample_org_info,))
self.company_info_id = self.cursor.fetchone()[0]

self.label_id = label.new_label_information(
self.cursor,
"test-label",
None,
None,
None,
None,
None,
None,
None,
None,
self.company_info_id,
self.company_info_id,
None,
)

def tearDown(self):
# Rollback any changes to leave the database state as it was before the test
self.conn.rollback()
Expand Down
28 changes: 0 additions & 28 deletions tests/fertiscan/db/update_inspection/test_update_ingredients.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,6 @@ def setUp(self):
}
)

# Insert test data to obtain a valid label_id
sample_org_info = json.dumps(
{
"name": "Test Company",
"address": "123 Test Address",
"website": "http://www.testcompany.com",
"phone_number": "+1 800 555 0123",
}
)
self.cursor.execute("SELECT upsert_organization_info(%s);", (sample_org_info,))
self.company_info_id = self.cursor.fetchone()[0]

self.label_id = label.new_label_information(
self.cursor,
"test-label",
None,
None,
None,
None,
None,
None,
None,
False,
self.company_info_id,
self.company_info_id,
None,
)

def tearDown(self):
# Rollback any changes to leave the database state as it was before the test
self.conn.rollback()
Expand Down
17 changes: 9 additions & 8 deletions tests/fertiscan/db/update_inspection/test_update_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def setUp(self):
create_input_json = json.load(file)

create_input_json_str = json.dumps(create_input_json)
print(create_input_json["organizations"])
#print(create_input_json["organizations"])

# Create initial inspection data in the database
self.picture_set_id = None # No picture set ID for this test case
Expand All @@ -77,15 +77,15 @@ def setUp(self):
(self.inspector_id, self.picture_set_id, create_input_json_str),
)
self.created_data = self.cursor.fetchone()[0]
print(self.created_data["organizations"])
#print(self.created_data["organizations"])
self.created_inspection = Inspection.model_validate(self.created_data)

foo = organization.get_organizations_info_label(

Check failure on line 83 in tests/fertiscan/db/update_inspection/test_update_inspection.py

View workflow job for this annotation

GitHub Actions / datastore-lint-test-python / lint-test

Ruff (F841)

tests/fertiscan/db/update_inspection/test_update_inspection.py:83:9: F841 Local variable `foo` is assigned to but never used
self.cursor, self.created_data["product"]["label_id"]
)
print("=========")
print(foo)
print("=========")
#print("=========")
#print(foo)
#print("=========")
# Store the inspection ID for later use
self.inspection_id = self.created_data.get("inspection_id")

Expand Down Expand Up @@ -118,7 +118,8 @@ def test_update_inspection_with_verified_false(self):
self.inspector_id,
altered_inspection.model_dump(),
)
Inspection.model_validate(**update_inspection_result)
print(update_inspection_result)
Inspection.model_validate(update_inspection_result)

# Verify the inspection record was updated in the database
updated_inspection = get_inspection_dict(self.cursor, self.inspection_id)
Expand Down Expand Up @@ -195,9 +196,9 @@ def test_update_inspection_with_verified_false(self):
"SELECT value FROM guaranteed WHERE label_id = %s AND read_name = %s;",
(self.created_data["product"]["label_id"], "Total Nitrogen (N)"),
)
print(self.created_data["product"]["label_id"])
#print(self.created_data["product"]["label_id"])
updated_nitrogen_value = self.cursor.fetchone()[0]
print(updated_nitrogen_value)
#print(updated_nitrogen_value)
self.assertEqual(
updated_nitrogen_value,
new_value,
Expand Down

0 comments on commit 5bd9cc4

Please sign in to comment.