Ejemplo n.º 1
0
    def test_get_config_on_demand_capable_false(self):
        """Ensure we fail correctly if ASUP is not available on this platform"""
        self._set_args()

        expected = dict(asupCapable=True, onDemandCapable=False)
        asup = Asup()
        # Expecting an update
        with self.assertRaisesRegexp(AnsibleFailJson, r"not supported"):
            with mock.patch(self.REQ_FUNC, return_value=(200, expected)):
                asup.get_configuration()
Ejemplo n.º 2
0
    def test_get_config(self):
        """Validate retrieving the ASUP configuration"""
        self._set_args()

        expected = dict(asupCapable=True, onDemandCapable=True)
        asup = Asup()

        with mock.patch(self.REQ_FUNC, return_value=(200, expected)):
            config = asup.get_configuration()
            self.assertEqual(config, expected)