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)
def test_programmatic_missing_keys(self): conf = Configuration() conf.add_machine_conf(MachineConfiguration()) with self.assertRaises(jsonschema.exceptions.ValidationError) as _: conf.finalize()