mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-14 12:43:24 +02:00
Add test for set profile image db method (#1656)
This commit is contained in:
parent
0fa9755dea
commit
1a4e46c439
1 changed files with 20 additions and 0 deletions
|
|
@ -115,6 +115,11 @@ def new_profile_name():
|
|||
yield "new_fake_profile_name"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def profile_image_bytes():
|
||||
yield bytes.fromhex("deadbeef")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def profile_with_custom_price_id(squeak_db, inserted_contact_profile_id, custom_price_msat):
|
||||
squeak_db.set_profile_custom_price_msat(
|
||||
|
|
@ -133,6 +138,15 @@ def profile_with_new_name_id(squeak_db, inserted_contact_profile_id, new_profile
|
|||
yield inserted_contact_profile_id
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def profile_with_image_id(squeak_db, inserted_contact_profile_id, profile_image_bytes):
|
||||
squeak_db.set_profile_image(
|
||||
inserted_contact_profile_id,
|
||||
profile_image_bytes,
|
||||
)
|
||||
yield inserted_contact_profile_id
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def deleted_profile_id(squeak_db, inserted_contact_profile_id):
|
||||
squeak_db.delete_profile(
|
||||
|
|
@ -400,6 +414,12 @@ def test_set_profile_name(squeak_db, profile_with_new_name_id, new_profile_name)
|
|||
assert profile.profile_name == new_profile_name
|
||||
|
||||
|
||||
def test_set_profile_image(squeak_db, profile_with_image_id, profile_image_bytes):
|
||||
profile = squeak_db.get_profile(profile_with_image_id)
|
||||
|
||||
assert profile.profile_image == profile_image_bytes
|
||||
|
||||
|
||||
def test_deleted_profile(squeak_db, deleted_profile_id):
|
||||
profile = squeak_db.get_profile(deleted_profile_id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue