Revision 1f87d93d

b/test/hs/Test/Ganeti/Ssconf.hs
31 31
import Test.QuickCheck
32 32

  
33 33
import Data.List
34
import qualified Data.Map as M
34 35

  
35 36
import Test.Ganeti.TestHelper
37
import Test.Ganeti.TestCommon
36 38

  
37 39
import qualified Ganeti.Ssconf as Ssconf
38 40

  
......
40 42

  
41 43
$(genArbitrary ''Ssconf.SSKey)
42 44

  
45
instance Arbitrary Ssconf.SSConf where
46
  arbitrary = fmap (Ssconf.SSConf . M.fromList) arbitrary
47

  
48
-- * Reading SSConf
49

  
43 50
prop_filename :: Ssconf.SSKey -> Property
44 51
prop_filename key =
45 52
  printTestCase "Key doesn't start with correct prefix" $
46 53
    Ssconf.sSFilePrefix `isPrefixOf` Ssconf.keyToFilename "" key
47 54

  
55
-- * Creating and writing SSConf
56

  
57
-- | Verify that for SSConf we have readJSON . showJSON = Ok.
58
prop_ReadShow :: Ssconf.SSConf -> Property
59
prop_ReadShow = testSerialisation
60

  
48 61
testSuite "Ssconf"
49 62
  [ 'prop_filename
63
  , 'prop_ReadShow
50 64
  ]

Also available in: Unified diff