Revision 497beee2 htest/Test/Ganeti/Types.hs

b/htest/Test/Ganeti/Types.hs
103 103

  
104 104
$(genArbitrary ''IAllocatorMode)
105 105

  
106
$(genArbitrary ''NICMode)
107

  
106 108
-- * Properties
107 109

  
108 110
prop_AllocPolicy_serialisation :: AllocPolicy -> Property
......
231 233
      all_hs_codes = sort $ map Types.iAllocatorModeToRaw [minBound..maxBound]
232 234
  assertEqual "for IAllocatorMode equivalence" all_py_codes all_hs_codes
233 235

  
236
-- | Test 'NICMode' serialisation.
237
prop_NICMode_serialisation :: NICMode -> Property
238
prop_NICMode_serialisation = testSerialisation
239

  
240
-- | Tests equivalence with Python, based on Constants.hs code.
241
case_NICMode_pyequiv :: Assertion
242
case_NICMode_pyequiv = do
243
  let all_py_codes = sort C.nicValidModes
244
      all_hs_codes = sort $ map Types.nICModeToRaw [minBound..maxBound]
245
  assertEqual "for NICMode equivalence" all_py_codes all_hs_codes
246

  
234 247
testSuite "Types"
235 248
  [ 'prop_AllocPolicy_serialisation
236 249
  , 'prop_DiskTemplate_serialisation
......
258 271
  , 'prop_IAllocatorTestDir_serialisation
259 272
  , 'prop_IAllocatorMode_serialisation
260 273
  , 'case_IAllocatorMode_pyequiv
274
  , 'prop_NICMode_serialisation
275
  , 'case_NICMode_pyequiv
261 276
  ]

Also available in: Unified diff