forked from retoor/devplacepy
Keep composers usable, group actions and notifications, and drop the tool-count cap
Comment and post layouts stay full width on small screens. Secondary actions live in the More menu. Notifications can be grouped and throttled, and Enter can submit when that profile setting is on. Emulated-tool models accept large catalogs, with reserved names aliased on the wire and the catalog cached per owner. A dropped service-worker navigation is retried once. The test server waits 120s to finish importing before it is stopped.
This commit is contained in:
@@ -35,6 +35,31 @@ def _warp_stealable(username):
|
||||
)
|
||||
|
||||
|
||||
def _clear_golden(username, crop="python"):
|
||||
from devplacepy.database import get_table
|
||||
from devplacepy.services.game import economy, store
|
||||
|
||||
user = get_table("users").find_one(username=username)
|
||||
farm = store.get_farm(user["uid"])
|
||||
for plot in store.get_plots(farm["uid"]):
|
||||
if plot.get("crop_key") != crop:
|
||||
continue
|
||||
raw = plot.get("planted_at") or ""
|
||||
try:
|
||||
start = datetime.fromisoformat(raw)
|
||||
except ValueError:
|
||||
start = datetime.now(timezone.utc)
|
||||
for step in range(2000):
|
||||
candidate = (start + timedelta(seconds=step)).isoformat()
|
||||
if economy.is_golden(plot["uid"], candidate):
|
||||
continue
|
||||
if candidate != raw:
|
||||
get_table("game_plots").update(
|
||||
{"uid": plot["uid"], "planted_at": candidate}, ["uid"]
|
||||
)
|
||||
break
|
||||
|
||||
|
||||
def _farm_coins(username):
|
||||
from devplacepy.database import get_table
|
||||
from devplacepy.services.game import store
|
||||
@@ -128,6 +153,7 @@ def test_steal_takes_build_and_pays_thief(bob):
|
||||
reset_farm("bob_test", coins=0)
|
||||
_plant_growing("alice_test", crop="python")
|
||||
_warp_stealable("alice_test")
|
||||
_clear_golden("alice_test")
|
||||
alice_coins_before = _farm_coins("alice_test")
|
||||
page.goto(f"{BASE_URL}/game/farm/alice_test", wait_until="domcontentloaded")
|
||||
page.locator("[data-game-grid]").first.wait_for(state="visible")
|
||||
|
||||
Reference in New Issue
Block a user