Revision 8d239fa4 htest/Test/Ganeti/Types.hs

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

  
104 104
$(genArbitrary ''IAllocatorMode)
105 105

  
106
$(genArbitrary ''NetworkType)
107

  
106 108
$(genArbitrary ''NICMode)
107 109

  
108 110
-- * Properties
......
233 235
      all_hs_codes = sort $ map Types.iAllocatorModeToRaw [minBound..maxBound]
234 236
  assertEqual "for IAllocatorMode equivalence" all_py_codes all_hs_codes
235 237

  
238
-- | Test 'NetworkType' serialisation.
239
prop_NetworkType_serialisation :: NetworkType -> Property
240
prop_NetworkType_serialisation = testSerialisation
241

  
242
-- | Tests equivalence with Python, based on Constants.hs code.
243
case_NetworkType_pyequiv :: Assertion
244
case_NetworkType_pyequiv = do
245
  let all_py_codes = sort C.networkValidTypes
246
      all_hs_codes = sort $ map Types.networkTypeToRaw [minBound..maxBound]
247
  assertEqual "for NetworkType equivalence" all_py_codes all_hs_codes
248

  
236 249
-- | Test 'NICMode' serialisation.
237 250
prop_NICMode_serialisation :: NICMode -> Property
238 251
prop_NICMode_serialisation = testSerialisation
......
271 284
  , 'prop_IAllocatorTestDir_serialisation
272 285
  , 'prop_IAllocatorMode_serialisation
273 286
  , 'case_IAllocatorMode_pyequiv
287
  , 'prop_NetworkType_serialisation
288
  , 'case_NetworkType_pyequiv
274 289
  , 'prop_NICMode_serialisation
275 290
  , 'case_NICMode_pyequiv
276 291
  ]

Also available in: Unified diff