urbit/tests/app/acme.hoon

49 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-11-03 08:03:03 +03:00
/+ *test
::
/= app /: /===/app/acme
/!noun/
::
|%
:: tests that acme preps without moves
::
++ test-prep
=^ moves app (~(prep app *bowl:gall *acme:app) ~)
%+ expect-eq
!> *(list move:app)
!> moves
:: tests that acme inits on first order
::
++ test-first-order
=/ dom=(set turf) (sy /org/urbit/zod ~)
=^ moves app (~(poke-acme-order app *bowl:gall *acme:app) dom)
2019-01-14 23:32:07 +03:00
=/ msg 'requesting an https certificate for zod.urbit.org'
2018-11-03 08:03:03 +03:00
;: weld
%+ expect-eq
2019-01-14 23:32:07 +03:00
!> :~ =- [ost.bow.app [%poke / -]]
=- [[~zod %hall] %hall-action %phrase (sy [~zod %inbox] ~) -]
~[[%app %$ [%lin & msg]]]
[ost.bow.app %wait /acme/try/1/directory +(now.bow.app)]
2018-11-07 20:45:00 +03:00
==
2018-11-03 08:03:03 +03:00
!> moves
::
%+ expect-eq
!> [~ dom]
2019-01-14 23:32:07 +03:00
!> (some ~(key by (fall next-order.app ~)))
2018-11-03 08:03:03 +03:00
::
%+ expect-eq
!> &
!> !=(*key:rsa:app key.act.app)
::
%+ expect-eq
!> &
!> !=(*key:rsa:app cey.app)
==
:: tests that acme requests service directory on %wake
::
++ test-first-order-wake
2019-01-14 23:32:07 +03:00
=^ moves app (~(wake app *bowl:gall *acme:app) /acme/try/1/directory ~)
2018-11-03 08:03:03 +03:00
%+ expect-eq
2019-01-15 05:44:37 +03:00
!> ~[[ost.bow.app [%hiss /acme/try/2/directory ~ %httr %hiss directory-base:app %get ~ ~]]]
2018-11-03 08:03:03 +03:00
!> moves
--