Skip to content

Commit

Permalink
Fix test data
Browse files Browse the repository at this point in the history
  • Loading branch information
audiodude committed Jan 20, 2025
1 parent f828180 commit 1311ed0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions wp1/logic/builder_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime
from unittest.mock import call, patch, MagicMock, ANY
from unittest.mock import ANY, MagicMock, call, patch

import attr

Expand All @@ -14,7 +14,7 @@ class BuilderTest(BaseWpOneDbTest):
expected_builder = {
'b_id': b'1a-2b-3c-4d',
'b_name': b'My Builder',
'b_user_id': 1234,
'b_user_id': b'1234',
'b_project': b'en.wikipedia.fake',
'b_model': b'wp1.selection.models.simple',
'b_params': b'{"list": ["a", "b", "c"]}',
Expand Down Expand Up @@ -269,7 +269,7 @@ def _insert_selection(self,
def _get_builder_by_user_id(self):
with self.wp10db.cursor() as cursor:
cursor.execute('SELECT * FROM builders WHERE b_user_id=%(b_user_id)s',
{'b_user_id': '1234'})
{'b_user_id': b'1234'})
db_lists = cursor.fetchone()
return db_lists

Expand All @@ -278,7 +278,7 @@ def setUp(self):
self.builder = Builder(
b_id=b'1a-2b-3c-4d',
b_name=b'My Builder',
b_user_id=1234,
b_user_id=b'1234',
b_project=b'en.wikipedia.fake',
b_model=b'wp1.selection.models.simple',
b_params=b'{"list": ["a", "b", "c"]}',
Expand Down Expand Up @@ -535,7 +535,7 @@ def test_update_builder_user_id_doesnt_match(self):
builder = Builder(
b_id=b'1a-2b-3c-4d',
b_name=b'My Builder',
b_user_id=5555, # Different user_id
b_user_id=b'5555', # Different user_id
b_project=b'en.wikipedia.fake',
b_model=b'wp1.selection.models.simple',
b_params=b'{"list": ["a", "b", "c"]}',
Expand All @@ -548,7 +548,7 @@ def test_update_builder_wrong_id(self):
builder = Builder(
b_id=b'100', # Wrong ID
b_name=b'My Builder',
b_user_id=1234,
b_user_id=b'1234',
b_project=b'en.wikipedia.fake',
b_model=b'wp1.selection.models.simple',
b_params=b'{"list": ["a", "b", "c"]}',
Expand All @@ -561,7 +561,7 @@ def test_update_builder_success(self):
builder = Builder(
b_id=b'1a-2b-3c-4d',
b_name=b'My Builder',
b_user_id=1234,
b_user_id=b'1234',
b_project=b'en.wikipedia.fake',
b_model=b'wp1.selection.models.simple',
b_params=b'{"list": ["a", "b", "c"]}',
Expand All @@ -573,7 +573,7 @@ def test_update_builder_updates_fields(self):
self._insert_builder()
builder = Builder(b_id=b'1a-2b-3c-4d',
b_name=b'Builder 2',
b_user_id=1234,
b_user_id=b'1234',
b_project=b'zz.wikipedia.fake',
b_model=b'wp1.selection.models.complex',
b_params=b'{"list": ["1", "b", "c"]}',
Expand Down

0 comments on commit 1311ed0

Please sign in to comment.