def test_create_selfip_idempotent(self, *args):
        set_module_args(
            dict(host='10.20.30.40',
                 name='mytestserver',
                 monitors=['/Common/icmp'],
                 partition='Common',
                 state='present',
                 password='******',
                 server='localhost',
                 user='******'))

        current = Parameters(params=load_fixture('load_ltm_node_3.json'))

        module = AnsibleModule(
            argument_spec=self.spec.argument_spec,
            supports_check_mode=self.spec.supports_check_mode)
        mm = ModuleManager(module=module)

        # Override methods to force specific logic in the module to happen
        mm.exists = Mock(side_effect=[True, True])
        mm.read_current_from_device = Mock(return_value=current)

        results = mm.exec_module()

        assert results['changed'] is False
Exemple #2
0
    def test_module_parameters(self):
        args = dict(
            host='10.20.30.40',
            name='10.20.30.40'
        )

        p = Parameters(params=args)
        assert p.host == '10.20.30.40'
        assert p.name == '10.20.30.40'
Exemple #3
0
    def test_api_parameters(self):
        args = load_fixture('load_ltm_node_1.json')

        p = Parameters(params=args)
        assert p.address == '1.2.3.4'