def test_update_ipv4_net_access(self, *args):
        set_module_args(dict(
            name='test',
            excluded_ipv4_adresses=[dict(subnet='10.10.10.1')],
            ipv4_address_space=[dict(subnet='192.168.1.0/24')],
            provider=dict(
                server='localhost',
                password='******',
                user='******'
            )
        ))

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

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

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

        results = mm.exec_module()

        assert results['changed'] is True
        assert results['excluded_ipv4_adresses'] == [dict(subnet='10.10.10.1')]
        assert results['ipv4_address_space'] == [dict(subnet='192.168.1.0/24')]
    def test_api_parameters(self):
        args = load_fixture('load_apm_network_access.json')

        p = ApiParameters(params=args)
        assert p.name == 'test'
        assert p.ip_version == 'ipv4-ipv6'
        assert p.split_tunnel == 'true'
        assert p.allow_local_subnet == 'true'
        assert p.allow_local_dns == 'true'
        assert p.snat_pool == 'automap'
        assert p.dtls == 'false'
        assert p.dtls_port == 4433
        assert p.ipv4_lease_pool == '/Common/ipv4lease'
        assert p.excluded_ipv4_adresses == [
            dict(subnet='192.168.1.0/24'),
            dict(subnet='192.168.2.1/32')
        ]
        assert p.ipv4_address_space == [
            dict(subnet='10.10.10.1/32'),
            dict(subnet='10.11.11.0/24')
        ]
        assert p.dns_address_space == ['foo.com', 'bar.com']
        assert p.excluded_dns_addresses == ['baz.com', 'bazfoo.com']
        assert p.ipv6_address_space == [
            dict(subnet="2607:f0d0:1002:51::4/128")
        ]