Revision adb77e3a htools/Ganeti/HTools/QC.hs
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
51 | 51 |
, testRpc |
52 | 52 |
, testQlang |
53 | 53 |
, testConfd |
54 |
, testObjects |
|
54 | 55 |
) where |
55 | 56 |
|
56 | 57 |
import qualified Test.HUnit as HUnit |
... | ... | |
2161 | 2162 |
[ 'prop_Confd_req_sign |
2162 | 2163 |
, 'prop_Confd_bad_key |
2163 | 2164 |
] |
2165 |
|
|
2166 |
-- * Objects tests |
|
2167 |
|
|
2168 |
-- | Tests that fillDict behaves correctly |
|
2169 |
prop_Objects_fillDict :: [(Int, Int)] -> [(Int, Int)] -> Property |
|
2170 |
prop_Objects_fillDict defaults custom = |
|
2171 |
let d_map = Map.fromList defaults |
|
2172 |
d_keys = map fst defaults |
|
2173 |
c_map = Map.fromList custom |
|
2174 |
c_keys = map fst custom |
|
2175 |
in printTestCase "Empty custom filling" |
|
2176 |
(Objects.fillDict d_map Map.empty [] == d_map) .&&. |
|
2177 |
printTestCase "Empty defaults filling" |
|
2178 |
(Objects.fillDict Map.empty c_map [] == c_map) .&&. |
|
2179 |
printTestCase "Delete all keys" |
|
2180 |
(Objects.fillDict d_map c_map (d_keys++c_keys) == Map.empty) |
|
2181 |
|
|
2182 |
testSuite "Objects" |
|
2183 |
[ 'prop_Objects_fillDict |
|
2184 |
] |
Also available in: Unified diff