    base.update(over)
    return base


# --------------------------------------------------------------------------- accounts
class TestAccountsApi:

    def test_list_empty(self, api):
        d = api.get("/gmail/accounts").json()
        assert d["accounts"] == [] and d["count"] == 0

    def test_seeded_account_shape(self, api, db):
        aid = _seed_account(db, user_id_of(api))
        d = api.get("/gmail/accounts").json()
        assert d["count"] == 1
        a = d["accounts"][0]
        assert {"id", "email", "status", "sending_method", "daily_limit",
                "campaign_limit", "sends_today", "has_refresh_token",
                "authorized"} <= set(a)
        assert a["id"] == aid and a["authorized"] is True
        assert a["has_refresh_token"] is True
