on master help sign in
Implement listcontainer test fully

That means we need to run a container before invoking listContainers.

commit10bad6af1257f14edfa2cc8201a17b826682b472 authorDeni Bertovic <deni@denibertovic.com> dateTue 9 Jan 2018, 00:46 (9 years ago) parent79c8ae4
1 file changed+6−9
tests/tests.hs+6−9
tests/tests.hs+6−9
@@ -73,15 +73,12 @@ testFindImage =
7373
7474testListContainers :: IO ()
7575testListContainers =
76− runDocker $ do
77− res <- listContainers $ ListOpts { all=True }
78− case res of
79− Right cs -> do
80− forM_ cs $ \r -> do
81− lift $ print (containerNetworks r)
82− lift $ print (containerStatus r)
83− Left e -> lift $ print e
84− lift $ assert $ isRight res
76+ runDocker $
77+ do containerId <- createContainer (defaultCreateOpts (testImageName <> ":latest")) Nothing
78+ c <- fromRight containerId
79+ res <- listContainers $ ListOpts { all=True }
80+ deleteContainer (DeleteOpts True True) c
81+ lift $ assert $ isRight res
8582
8683testBuildFromDockerfile :: IO ()
8784testBuildFromDockerfile = do