Skip to content
Prev Previous commit
Next Next commit
🐍🌚🤖 Formatted using black.
  • Loading branch information
Mariatta committed Dec 30, 2018
commit 143ce38d763870651f4f3bd37f5a9326f3ff4c44
14 changes: 12 additions & 2 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from blurb_it import util


class FakeGH:
def __init__(self, *, getiter=None, getitem=None, post=None, patch=None):
self._getitem_return = getitem
Expand Down Expand Up @@ -45,7 +46,16 @@ async def post(self, url, *, data):


async def test_nonceify():
body = "Lorem ipsum dolor amet flannel squid normcore tbh raclette enim" "pabst tumblr wolf farm-to-table bitters. Bitters keffiyeh next" "level proident normcore, et all of +1 90's in blue bottle" "chillwave lorem. Id keffiyeh microdosing cupidatat pour-over" "paleo farm-to-table tumeric sriracha +1. Raclette in poutine," "bushwick kitsch id pariatur hexagon. Thundercats shaman beard," "nulla swag echo park organic microdosing. Hot chicken tbh pop-up" "tacos, asymmetrical tilde veniam bespoke reprehenderit ut do."
body = (
"Lorem ipsum dolor amet flannel squid normcore tbh raclette enim"
"pabst tumblr wolf farm-to-table bitters. Bitters keffiyeh next"
"level proident normcore, et all of +1 90's in blue bottle"
"chillwave lorem. Id keffiyeh microdosing cupidatat pour-over"
"paleo farm-to-table tumeric sriracha +1. Raclette in poutine,"
"bushwick kitsch id pariatur hexagon. Thundercats shaman beard,"
"nulla swag echo park organic microdosing. Hot chicken tbh pop-up"
"tacos, asymmetrical tilde veniam bespoke reprehenderit ut do."
)

nonce = await util.nonceify(body)
assert nonce == "Ps4kgC"
Expand Down Expand Up @@ -98,4 +108,4 @@ async def test_is_core_dev():
}
gh = FakeGH(getiter={"/orgs/python/teams": teams}, getitem=getitem)
with pytest.raises(gidgethub.BadRequest):
await util.is_core_dev(gh, "miss-islington")
await util.is_core_dev(gh, "miss-islington")