Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove orjson #37

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
orjson
python-dateutil
setuptools-rust
typing_extensions
1 change: 0 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
coverage
orjson
pytest
python-dateutil
typing_extensions
4 changes: 1 addition & 3 deletions tests/test_bets_bustproof.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import json

import orjson

from neofoodclub import Bets, Modifier, NeoFoodClub


Expand Down Expand Up @@ -59,7 +57,7 @@ def test_bustproof_equivalence(nfc_with_bet_amount: NeoFoodClub) -> None:

def test_bustproof_generator_no_positives(nfc: NeoFoodClub) -> None:
# modify our round object to have no positives (just need to change the last arena for this one)
round_data = orjson.loads(nfc.to_json())
round_data = json.loads(nfc.to_json())
# will give the arena a -50% ratio
round_data["currentOdds"][-1] = [1, 2, 2, 2, 2]
no_positive_nfc = NeoFoodClub(json.dumps(round_data))
Expand Down
3 changes: 1 addition & 2 deletions tests/test_modifiers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import datetime
import json

import orjson
import pytest

from neofoodclub import Modifier, NeoFoodClub
Expand Down Expand Up @@ -79,7 +78,7 @@ def test_modifier_time_with_nfc(nfc: NeoFoodClub) -> None:


def test_modifier_time_and_reset_no_start(nfc: NeoFoodClub) -> None:
new_data = orjson.loads(nfc.to_json())
new_data = json.loads(nfc.to_json())
# remove the start time of the round so we can have an indeterminate start time
new_data.pop("start")
modifier = Modifier(
Expand Down
9 changes: 4 additions & 5 deletions tests/test_neofoodclub.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import datetime
import json

import orjson
import pytest

from neofoodclub import Modifier, NeoFoodClub
Expand Down Expand Up @@ -173,7 +172,7 @@ def test_changes_equivalence(nfc: NeoFoodClub) -> None:
def test_removed_timestamp(nfc: NeoFoodClub) -> None:
# timestamp isn't really needed, so if it doesn't exist,
# we just return None
data = orjson.loads(nfc.to_json())
data = json.loads(nfc.to_json())

data.pop("timestamp")

Expand All @@ -195,14 +194,14 @@ def test_outdated_lock(nfc: NeoFoodClub) -> None:

def test_outdated_lock_false(nfc: NeoFoodClub) -> None:
now = datetime.datetime.now(datetime.timezone.utc)
data = orjson.loads(nfc.to_json())
data = json.loads(nfc.to_json())
data["start"] = now.isoformat()
new_nfc = NeoFoodClub(json.dumps(data))
assert new_nfc.is_outdated_lock is False


def test_outdated_lock_none(nfc: NeoFoodClub) -> None:
data = orjson.loads(nfc.to_json())
data = json.loads(nfc.to_json())

# if there's no start attribute, assume it's over
data.pop("start")
Expand All @@ -216,7 +215,7 @@ def test_winning_pirates(nfc: NeoFoodClub) -> None:


def test_winning_pirates_empty(nfc: NeoFoodClub) -> None:
data = orjson.loads(nfc.to_json())
data = json.loads(nfc.to_json())
# monkeypatching in no winners
data["winners"] = (0, 0, 0, 0, 0)

Expand Down
Loading