Skip to content

Commit

Permalink
Update and modify files for the project
Browse files Browse the repository at this point in the history
- Updated files:
  - src/bee_py/modules/chunk.py
  - tests/conftest.py
  - tests/integration/modules/test_chunk.py
  - tests/integration/modules/test_pss.py
  • Loading branch information
Aviksaikat committed Nov 30, 2023
1 parent 40a7d6b commit d300c15
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/bee_py/modules/chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def upload(
"data": data,
"headers": {**extract_upload_headers(postage_batch_id, options)},
}
print(config)

response = http(request_options, config)
print("PoGO")

if response.status_code != 200: # noqa: PLR2004
logger.info(response.json())
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def bee_debug_ky_options(bee_peer_debug_url) -> dict:
@pytest.fixture
def read_local_bee_stamp() -> str:
with open(BEE_DATA_FILE) as f:
stamp = json.loads(f)
stamp = json.loads(f.read())
if stamp["BEE_POSTAGE"]:
return stamp["BEE_POSTAGE"]
return False
Expand All @@ -99,7 +99,7 @@ def read_local_bee_stamp() -> str:
@pytest.fixture
def read_local_bee_peer_stamp() -> str:
with open(BEE_DATA_FILE) as f:
stamp = json.loads(f)
stamp = json.loads(f.read())
if stamp["BEE_PEER_POSTAGE"]:
return stamp["BEE_PEER_POSTAGE"]
return False
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/modules/test_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
from bee_py.modules.chunk import download, upload


def test_store_retreive_data(bee_ky_options, get_debug_postage):
def test_store_retreive_data(bee_ky_options):
payload = bytes([1, 2, 3])
span = bytes([len(payload), 0, 0, 0, 0, 0, 0, 0])
data = bytes([*span, *payload])

get_debug_postage = "17b325d7ad88098eb2065ebfd505134fb61ee6b4fb2b44f9a44d97067f8c741d"

reference = "ca6357a08e317d15ec560fef34e4c45f8f19f01c372aa70f1da72bfa7f1a4338"
# the hash is hardcoded because we would need the bmt hasher otherwise
response = upload(bee_ky_options, data, get_debug_postage)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/modules/test_pss.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_send_receive_pss_message(bee_url, bee_peer_ky_options, bee_debug_ky_opt
ws = subscribe(bee_url, topic)

addresses = get_node_addresses(bee_debug_ky_options)
target = addresses["overlay"]
target = addresses.overlay
send(bee_peer_ky_options, topic, make_test_target(target), message, get_peer_debug_postage)

received_message = ws.receive()
Expand Down

0 comments on commit d300c15

Please sign in to comment.