Esempio n. 1
0
 def test_from_dictionnary(self):
     d = {
         "roles": ["r1"],
         "flavour": "large",
         "number": 2,
         "cluster": "test-cluster"
     }
     conf = MachineConfiguration.from_dictionnary(d)
     self.assertEqual(constants.FLAVOURS["large"], conf.flavour)
     self.assertEqual(2, conf.number)
Esempio n. 2
0
 def test_from_dictionnary_flavour_desc(self):
     flavour_desc = {"core": 42, "mem": 42}
     d = {
         "roles": ["r1"],
         "flavour_desc": flavour_desc,
         "number": 2,
         "cluster": "test-cluster"
     }
     conf = MachineConfiguration.from_dictionnary(d)
     self.assertEqual(flavour_desc, conf.flavour_desc)
     self.assertEqual(2, conf.number)
Esempio n. 3
0
 def test_from_dictionnary_minimal(self):
     d = {"roles": ["r1"], "cluster": "test-cluster"}
     conf = MachineConfiguration.from_dictionnary(d)
     self.assertEqual(constants.DEFAULT_FLAVOUR, conf.flavour)