Revision 5cfa6c37 test/hs/Test/Ganeti/Types.hs
b/test/hs/Test/Ganeti/Types.hs | ||
---|---|---|
112 | 112 |
|
113 | 113 |
$(genArbitrary ''IAllocatorMode) |
114 | 114 |
|
115 |
$(genArbitrary ''NetworkType) |
|
116 |
|
|
117 | 115 |
$(genArbitrary ''NICMode) |
118 | 116 |
|
119 | 117 |
$(genArbitrary ''JobStatus) |
... | ... | |
287 | 285 |
all_hs_codes = sort $ map Types.iAllocatorModeToRaw [minBound..maxBound] |
288 | 286 |
assertEqual "for IAllocatorMode equivalence" all_py_codes all_hs_codes |
289 | 287 |
|
290 |
-- | Test 'NetworkType' serialisation. |
|
291 |
prop_NetworkType_serialisation :: NetworkType -> Property |
|
292 |
prop_NetworkType_serialisation = testSerialisation |
|
293 |
|
|
294 |
-- | Tests equivalence with Python, based on Constants.hs code. |
|
295 |
case_NetworkType_pyequiv :: Assertion |
|
296 |
case_NetworkType_pyequiv = do |
|
297 |
let all_py_codes = sort C.networkValidTypes |
|
298 |
all_hs_codes = sort $ map Types.networkTypeToRaw [minBound..maxBound] |
|
299 |
assertEqual "for NetworkType equivalence" all_py_codes all_hs_codes |
|
300 |
|
|
301 | 288 |
-- | Test 'NICMode' serialisation. |
302 | 289 |
prop_NICMode_serialisation :: NICMode -> Property |
303 | 290 |
prop_NICMode_serialisation = testSerialisation |
... | ... | |
417 | 404 |
, 'prop_IAllocatorTestDir_serialisation |
418 | 405 |
, 'prop_IAllocatorMode_serialisation |
419 | 406 |
, 'case_IAllocatorMode_pyequiv |
420 |
, 'prop_NetworkType_serialisation |
|
421 |
, 'case_NetworkType_pyequiv |
|
422 | 407 |
, 'prop_NICMode_serialisation |
423 | 408 |
, 'prop_OpStatus_serialization |
424 | 409 |
, 'prop_JobStatus_serialization |
Also available in: Unified diff