on master help sign in
Fixes failing tests
commitfe96d40db2bd455981bc63ce0258ac519be7150f authorDeni Bertovic <deni@denibertovic.com> dateFri 2 Sep 2016, 01:07 (10 years ago) parent5bd2a89
2 files changed+6−5
src/Docker/Client/Types.hs+4−3 tests/tests.hs+2−2
src/Docker/Client/Types.hs+4−3
@@ -208,7 +208,7 @@ data ContainerDetails = ContainerDetails {
208208 , containerDetailsId :: ContainerID
209209 , containerDetailsImage :: ImageID
210210 , mountLabel :: Text
211− , names :: [Text]
211+ , name :: Text
212212 , networkSettings :: NetworkSettings
213213 , path :: FilePath
214214 , processLabel :: Text
@@ -335,7 +335,7 @@ instance FromJSON ContainerDetails where
335335 id <- parseJSON v
336336 image <- o .: "Image"
337337 mountLabel <- o .: "MountLabel"
338− names <- o .: "Names"
338+ name <- o .: "Name"
339339 networkSettings <- o .: "NetworkSettings"
340340 path <- o .: "Path"
341341 processLabel <- o .: "ProcessLabel"
@@ -343,7 +343,7 @@ instance FromJSON ContainerDetails where
343343 restartCount <- o .: "RestartCount"
344344 state <- o .: "State"
345345 mounts <- o .: "Mounts"
346− return $ ContainerDetails appArmor args config created driver hostConfig hostnamePath hostsPath logPath id image mountLabel names networkSettings path processLabel resolveConfPath restartCount state mounts
346+ return $ ContainerDetails appArmor args config created driver hostConfig hostnamePath hostsPath logPath id image mountLabel name networkSettings path processLabel resolveConfPath restartCount state mounts
347347 parseJSON _ = fail "ContainerDetails is not an object"
348348
349349instance ToJSON ContainerID where
@@ -752,6 +752,7 @@ instance ToJSON [Volume] where
752752
753753instance FromJSON [Volume] where
754754 parseJSON (JSON.Object o) = return $ map (Volume . T.unpack) $ HM.keys o
755+ parseJSON (JSON.Null) = return []
755756 parseJSON _ = fail "Volume is not an object"
756757
757758
tests/tests.hs+2−2
@@ -57,7 +57,7 @@ testFindImage = runDocker $ do
5757
5858testRunAndReadLog :: IO ()
5959testRunAndReadLog = runDocker $ do
60− containerId <- createContainer (defaultCreateOpts (testImageName <> ":latest"))
60+ containerId <- createContainer (defaultCreateOpts (testImageName <> ":latest")) Nothing
6161 c <- fromRight containerId
6262 status1 <- startContainer defaultStartOpts c
6363 _ <- inspectContainer c >>= fromRight
@@ -83,7 +83,7 @@ testVolumesJson = testGroup "Testing Volumes JSON" [ testSample1, testSample2 ]
8383 where
8484 testSample1 = testCase "Test exposing volume: /tmp" $ assert $ JSON.toJSON sampleVolumes ^. key "/tmp" . _Object == HM.empty
8585 testSample2 = testCase "Test exposing volume: /opt" $ assert $ JSON.toJSON sampleVolumes ^. key "/opt" . _Object == HM.empty
86− sampleVolumes = Volumes ["/tmp", "/opt"]
86+ sampleVolumes = [Volume "/tmp", Volume "/opt"]
8787
8888integrationTests :: TestTree
8989integrationTests = testGroup "Integration Tests" [