def test_programmatic(self): conf = Configuration() conf.add_machine_conf(MachineConfiguration(roles=["r1"], flavour=FLAVOURS["large"], number=10))\ .add_network_conf(NetworkConfiguration(roles=["net1"], cidr="192.168.2.1/24")) conf.finalize() self.assertEqual(1, len(conf.machines))
def test_programmatic_missing_keys(self): conf = Configuration() conf.add_machine_conf(MachineConfiguration()) with self.assertRaises(jsonschema.exceptions.ValidationError) as _: conf.finalize()