Esempio n. 1
0
    def test_update_device_group(self, *args):
        set_module_args(
            dict(
                full_sync=True,
                name="foo-group",
                state="present",
                server='localhost',
                user='******',
                password='******'
            )
        )

        current = ApiParameters(params=load_fixture('load_tm_cm_device_group.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.update_on_device = Mock(return_value=True)
        mm.exists = Mock(return_value=True)
        mm.read_current_from_device = Mock(return_value=current)

        results = mm.exec_module()
        assert results['changed'] is True
Esempio n. 2
0
    def test_api_parameters(self):
        args = dict(asmSync="disabled",
                    autoSync="enabled",
                    fullLoadOnSync="false",
                    incrementalConfigSyncSizeMax=1024,
                    networkFailover="disabled",
                    saveOnAutoSync="false",
                    type="sync-only")

        p = ApiParameters(params=args)
        assert p.auto_sync is True
        assert p.full_sync is False
        assert p.max_incremental_sync_size == 1024
        assert p.save_on_auto_sync is False
        assert p.type == 'sync-only'