@ -11,9 +11,11 @@ import ./make-test-python.nix ({ lib, ... }: {
} ;
testScript = ''
import json
machine . wait_for_unit ( " p a p e r l e s s - n g - c o n s u m e r . s e r v i c e " )
with subtest ( " C r e a t e t e s t d o c " ) :
with subtest ( " A d d a d o c u m e n t v i a t h e f i l e s y s t e m " ) :
machine . succeed (
" c o n v e r t - s i z e 4 0 0 x 4 0 x c : w h i t e - f o n t ' D e j a V u - S a n s ' - p o i n t s i z e 2 0 - f i l l b l a c k "
" - a n n o t a t e + 5 + 2 0 ' h e l l o w o r l d 1 6 - 1 0 - 2 0 0 5 ' / v a r / l i b / p a p e r l e s s / c o n s u m e / d o c . p n g "
@ -24,7 +26,7 @@ import ./make-test-python.nix ({ lib, ... }: {
# Wait until server accepts connections
machine . wait_until_succeeds ( " c u r l - f s l o c a l h o s t : 2 8 9 8 1 " )
with subtest ( " C r e a t e w e b t e s t d o c " ) :
with subtest ( " A d d a d o c u m e n t v i a t h e w e b i n t e r f a c e " ) :
machine . succeed (
" c o n v e r t - s i z e 4 0 0 x 4 0 x c : w h i t e - f o n t ' D e j a V u - S a n s ' - p o i n t s i z e 2 0 - f i l l b l a c k "
" - a n n o t a t e + 5 + 2 0 ' h e l l o w e b 1 6 - 1 0 - 2 0 0 5 ' / t m p / w e b d o c . p n g "
@ -35,11 +37,8 @@ import ./make-test-python.nix ({ lib, ... }: {
machine . wait_until_succeeds (
" ( ( $ ( c u r l - u a d m i n : a d m i n - f s l o c a l h o s t : 2 8 9 8 1 / a p i / d o c u m e n t s / | j q . c o u n t ) = = 2 ) ) "
)
assert " 2 0 0 5 - 1 0 - 1 6 " in machine . succeed (
" c u r l - u a d m i n : a d m i n - f s l o c a l h o s t : 2 8 9 8 1 / a p i / d o c u m e n t s / | j q ' . r e s u l t s | . [ 0 ] | . c r e a t e d ' "
)
assert " 2 0 0 5 - 1 0 - 1 6 " in machine . succeed (
" c u r l - u a d m i n : a d m i n - f s l o c a l h o s t : 2 8 9 8 1 / a p i / d o c u m e n t s / | j q ' . r e s u l t s | . [ 1 ] | . c r e a t e d ' "
)
docs = json . loads ( machine . succeed ( " c u r l - u a d m i n : a d m i n - f s l o c a l h o s t : 2 8 9 8 1 / a p i / d o c u m e n t s / " ) ) [ ' results' ]
assert " 2 0 0 5 - 1 0 - 1 6 " in docs [ 0 ] [ ' created' ]
assert " 2 0 0 5 - 1 0 - 1 6 " in docs [ 1 ] [ ' created' ]
'' ;
} )