def test_create_authentication_object(self, *args):
        # Configure the arguments that would be sent to the Ansible module
        set_module_args(
            dict(
                name='foobar',
                ocsp=dict(fqdn='baz.bar.net',
                          dest='192.168.1.1/32',
                          ssl_profile='fake_ssl_1',
                          vlans=['/Common/vlan1', '/Common/vlan2']),
            ))

        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(return_value=False)
        mm.client.post = Mock(return_value=dict(
            code=202,
            contents=load_fixture('reply_sslo_auth_create_start.json')))
        mm.client.get = Mock(return_value=dict(
            code=200,
            contents=load_fixture('reply_sslo_auth_create_done.json')))

        results = mm.exec_module()
        assert results['changed'] is True
        assert results['ocsp']['fqdn'] == 'baz.bar.net'
        assert results['ocsp']['dest'] == '192.168.1.1%0/32'
        assert results['ocsp']['ssl_profile'] == 'fake_ssl_1'
        assert results['ocsp']['vlans'] == [{
            'name': '/Common/vlan1',
            'value': '/Common/vlan1'
        }, {
            'name': '/Common/vlan2',
            'value': '/Common/vlan2'
        }]
    def test_create_authentication_object_dump_json(self, *args):
        # Configure the arguments that would be sent to the Ansible module
        expected = load_fixture('sslo_auth_create_generated.json')
        set_module_args(
            dict(name='foobar',
                 ocsp=dict(fqdn='baz.bar.net',
                           dest='192.168.1.1/32',
                           ssl_profile='fake_ssl_1',
                           vlans=['/Common/vlan1', '/Common/vlan2']),
                 dump_json=True))

        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(return_value=False)

        results = mm.exec_module()

        assert results['changed'] is False
        assert results['json'] == expected