Revision e5a29b6c htools/Ganeti/HTools/QC.hs

b/htools/Ganeti/HTools/QC.hs
51 51
  , testRpc
52 52
  , testQlang
53 53
  , testConfd
54
  , testObjects
55 54
  ) where
56 55

  
57 56
import qualified Test.HUnit as HUnit
......
2173 2172
  [ 'prop_Confd_req_sign
2174 2173
  , 'prop_Confd_bad_key
2175 2174
  ]
2176

  
2177
-- * Objects tests
2178

  
2179
-- | Tests that fillDict behaves correctly
2180
prop_Objects_fillDict :: [(Int, Int)] -> [(Int, Int)] -> Property
2181
prop_Objects_fillDict defaults custom =
2182
  let d_map = Map.fromList defaults
2183
      d_keys = map fst defaults
2184
      c_map = Map.fromList custom
2185
      c_keys = map fst custom
2186
  in printTestCase "Empty custom filling"
2187
      (Objects.fillDict d_map Map.empty [] == d_map) .&&.
2188
     printTestCase "Empty defaults filling"
2189
      (Objects.fillDict Map.empty c_map [] == c_map) .&&.
2190
     printTestCase "Delete all keys"
2191
      (Objects.fillDict d_map c_map (d_keys++c_keys) == Map.empty)
2192

  
2193
testSuite "Objects"
2194
  [ 'prop_Objects_fillDict
2195
  ]

Also available in: Unified diff