Revision 8c3b6093 test/hs/Test/Ganeti/Objects.hs
b/test/hs/Test/Ganeti/Objects.hs | ||
---|---|---|
247 | 247 |
res <- liftM Just (genBitString $ netmask2NumHosts netmask) |
248 | 248 |
ext_res <- liftM Just (genBitString $ netmask2NumHosts netmask) |
249 | 249 |
uuid <- arbitrary |
250 |
let n = Network name mac_prefix (Ip4Network net netmask) net6 gateway |
|
250 |
let n = Network name mac_prefix (Just $ Ip4Network net netmask) net6 gateway
|
|
251 | 251 |
gateway6 res ext_res uuid 0 Set.empty |
252 | 252 |
return n |
253 | 253 |
|
... | ... | |
373 | 373 |
\decoded = [objects.Network.FromDict(n) for n in net_data]\n\ |
374 | 374 |
\encoded = []\n\ |
375 | 375 |
\for net in decoded:\n\ |
376 |
\ a = network.AddressPool(net)\n\ |
|
377 |
\ encoded.append((a.GetFreeCount(), a.GetReservedCount(), \\\n\ |
|
378 |
\ net.ToDict()))\n\ |
|
376 |
\ a = network.Network(net)\n\ |
|
377 |
\ if net.network:\n\ |
|
378 |
\ encoded.append((a._GetFreeCount(), a._GetReservedCount(), \\\n\ |
|
379 |
\ net.ToDict()))\n\ |
|
380 |
\ else:\n\ |
|
381 |
\ encoded.append((-1, -1, \\\n\ |
|
382 |
\ net.ToDict()))\n\ |
|
379 | 383 |
\print serializer.Dump(encoded)" serialized |
380 | 384 |
>>= checkPythonResult |
381 | 385 |
let deserialised = J.decode py_stdout::J.Result [(Int, Int, Network)] |
Also available in: Unified diff