def test_update(self, *args): set_module_args( dict(banner_text='this is a banner', console_timeout=100, state='present', provider=dict(server='localhost', password='******', user='******'))) # Configure the parameters that would be returned by querying the # remote device current = ApiParameters( params=load_fixture('load_sys_global_settings.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(return_value=False) mm.read_current_from_device = Mock(return_value=current) mm.update_on_device = Mock(return_value=True) results = mm.exec_module() assert results['changed'] is True
def test_api_parameters(self): args = load_fixture('load_sys_global_settings.json') p = ApiParameters(params=args) assert 'Welcome to the BIG-IP Configuration Utility' in p.banner_text assert p.console_timeout == 0 assert p.gui_setup == 'no' assert p.lcd_display == 'yes' assert p.mgmt_dhcp == 'yes' assert p.net_reboot == 'no' assert p.quiet_boot == 'yes' assert p.security_banner == 'yes'