Revision 6903fea0 htest/Test/Ganeti/Types.hs
b/htest/Test/Ganeti/Types.hs | ||
---|---|---|
107 | 107 |
|
108 | 108 |
$(genArbitrary ''NICMode) |
109 | 109 |
|
110 |
$(genArbitrary ''FinalizedJobStatus) |
|
111 |
|
|
110 | 112 |
-- * Properties |
111 | 113 |
|
112 | 114 |
prop_AllocPolicy_serialisation :: AllocPolicy -> Property |
... | ... | |
257 | 259 |
all_hs_codes = sort $ map Types.nICModeToRaw [minBound..maxBound] |
258 | 260 |
assertEqual "for NICMode equivalence" all_py_codes all_hs_codes |
259 | 261 |
|
262 |
-- | Test 'FinalizedJobStatus' serialisation. |
|
263 |
prop_FinalizedJobStatus_serialisation :: FinalizedJobStatus -> Property |
|
264 |
prop_FinalizedJobStatus_serialisation = testSerialisation |
|
265 |
|
|
266 |
-- | Tests equivalence with Python, based on Constants.hs code. |
|
267 |
case_FinalizedJobStatus_pyequiv :: Assertion |
|
268 |
case_FinalizedJobStatus_pyequiv = do |
|
269 |
let all_py_codes = sort C.jobsFinalized |
|
270 |
all_hs_codes = sort $ map Types.finalizedJobStatusToRaw |
|
271 |
[minBound..maxBound] |
|
272 |
assertEqual "for FinalizedJobStatus equivalence" all_py_codes all_hs_codes |
|
273 |
|
|
260 | 274 |
testSuite "Types" |
261 | 275 |
[ 'prop_AllocPolicy_serialisation |
262 | 276 |
, 'prop_DiskTemplate_serialisation |
... | ... | |
288 | 302 |
, 'case_NetworkType_pyequiv |
289 | 303 |
, 'prop_NICMode_serialisation |
290 | 304 |
, 'case_NICMode_pyequiv |
305 |
, 'prop_FinalizedJobStatus_serialisation |
|
306 |
, 'case_FinalizedJobStatus_pyequiv |
|
291 | 307 |
] |
Also available in: Unified diff