mirror of
https://github.com/bsima/haskell-urbit-api.git
synced 2024-09-11 18:27:08 +03:00
add failing ack test
This commit is contained in:
parent
153ba3bf2b
commit
d60f5b7168
@ -7,6 +7,7 @@ module Urbit.Airlock
|
|||||||
Mark,
|
Mark,
|
||||||
connect,
|
connect,
|
||||||
poke,
|
poke,
|
||||||
|
ack,
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
|
48
test.hs
48
test.hs
@ -19,27 +19,35 @@ main :: IO ()
|
|||||||
main = do
|
main = do
|
||||||
let ship = fakezod
|
let ship = fakezod
|
||||||
|
|
||||||
testing "ship connection" $ isJust <$> do
|
testing "ship connection" $
|
||||||
r <- connect ship
|
isJust <$> do
|
||||||
return $ r ^? Wreq.responseBody
|
r <- connect ship
|
||||||
|
return $ r ^? Wreq.responseBody
|
||||||
|
|
||||||
testing "poke ship" $ isJust <$> do
|
testing "poke ship" $
|
||||||
r <- (poke ship "zod" "chat-hook" "json" $
|
isJust <$> do
|
||||||
Aeson.object
|
r <-
|
||||||
[ "message"
|
poke ship "zod" "chat-hook" "json" $
|
||||||
.= Aeson.object
|
Aeson.object
|
||||||
[ "path" .= Text.pack "/~/~zod/mc",
|
[ "message"
|
||||||
"envelope"
|
.= Aeson.object
|
||||||
.= Aeson.object
|
[ "path" .= Text.pack "/~/~zod/mc",
|
||||||
[ "uid" .= Text.pack "FIXME",
|
"envelope"
|
||||||
"number" .= lastEventId ship,
|
.= Aeson.object
|
||||||
"author" .= Text.pack "~zod",
|
[ "uid" .= Text.pack "FIXME",
|
||||||
"when" .= Text.pack "FIXME", -- int(time.time() * 1000)
|
"number" .= lastEventId ship,
|
||||||
"letter" .= Aeson.object ["text" .= Text.pack "hello world!"]
|
"author" .= Text.pack "~zod",
|
||||||
]
|
"when" .= Text.pack "FIXME", -- int(time.time() * 1000)
|
||||||
]
|
"letter" .= Aeson.object ["text" .= Text.pack "hello world!"]
|
||||||
])
|
]
|
||||||
return $ r ^? Wreq.responseBody
|
]
|
||||||
|
]
|
||||||
|
return $ r ^? Wreq.responseBody
|
||||||
|
|
||||||
|
testing "ack" $
|
||||||
|
isJust <$> do
|
||||||
|
r <- ack ship 1
|
||||||
|
return $ r ^? Wreq.responseBody
|
||||||
|
|
||||||
fakezod :: Ship
|
fakezod :: Ship
|
||||||
fakezod =
|
fakezod =
|
||||||
|
Loading…
Reference in New Issue
Block a user