def test_update_generic_peer(self, *args):
        set_module_args(
            dict(name='test',
                 auto_init_interval=3000,
                 ratio=120,
                 provider=dict(server='localhost',
                               password='******',
                               user='******')))

        current = ApiParameters(params=load_fixture('load_generic_peer.json'))

        module = AnsibleModule(
            argument_spec=self.spec.argument_spec,
            supports_check_mode=self.spec.supports_check_mode,
            required_if=self.spec.required_if)

        # Override methods in the specific type of manager
        gm = GenericModuleManager(module=module)
        gm.exists = Mock(return_value=True)
        gm.update_on_device = Mock(return_value=True)
        gm.read_current_from_device = Mock(return_value=current)

        mm = ModuleManager(module=module)
        mm.version_less_than_14 = Mock(return_value=False)
        mm.get_manager = Mock(return_value=gm)

        results = mm.exec_module()

        assert results['changed'] is True
        assert results['auto_init_interval'] == 3000
        assert results['ratio'] == 120
    def test_api_parameters(self):
        args = load_fixture('load_generic_peer.json')

        p = ApiParameters(params=args)
        assert p.name == 'test'
        assert p.partition == 'Common'
        assert p.description == 'foobar'
        assert p.auto_init == 'disabled'
        assert p.auto_init_interval == 5000
        assert p.connection_mode == 'per-peer'
        assert p.number_of_connections == 1
        assert p.pool == '/Common/example'
        assert p.ratio == 1
        assert p.transport_config == '/Common/test_tranport'