コード例 #1
0
 def test_programmatic(self):
     conf = Configuration()
     conf.add_machine_conf(
         MachineConfiguration(roles=["r1"],
                              flavour=constants.FLAVOURS["large"],
                              number=10,
                              cluster="test-cluster"))
     conf.finalize()
     self.assertEqual(1, len(conf.machines))
     # default networks
     self.assertEqual(constants.DEFAULT_NETWORKS, conf.networks)
コード例 #2
0
 def test_programmatic_missing_keys(self):
     conf = Configuration()
     conf.add_machine_conf(MachineConfiguration())
     with self.assertRaises(jsonschema.exceptions.ValidationError) as _:
         conf.finalize()