Beispiel #1
0
    def test_run_single_command(self, *args):
        set_module_args(
            dict(save='yes',
                 reset='yes',
                 merge_content='asdasd',
                 verify='no',
                 server='localhost',
                 user='******',
                 password='******'))

        client = AnsibleF5Client(
            argument_spec=self.spec.argument_spec,
            supports_check_mode=self.spec.supports_check_mode,
            f5_product_name=self.spec.f5_product_name)
        mm = ModuleManager(client)

        # Override methods to force specific logic in the module to happen
        mm.exit_json = Mock(return_value=True)
        mm.reset_device = Mock(return_value=True)
        mm.upload_to_device = Mock(return_value=True)
        mm.move_on_device = Mock(return_value=True)
        mm.merge_on_device = Mock(return_value=True)
        mm.remove_temporary_file = Mock(return_value=True)
        mm.save_on_device = Mock(return_value=True)

        results = mm.exec_module()

        assert results['changed'] is True
Beispiel #2
0
    def test_run_single_command(self, *args):
        set_module_args(dict(
            save='yes',
            reset='yes',
            merge_content='asdasd',
            verify='no',
            server='localhost',
            user='******',
            password='******'
        ))

        client = AnsibleF5Client(
            argument_spec=self.spec.argument_spec,
            supports_check_mode=self.spec.supports_check_mode,
            f5_product_name=self.spec.f5_product_name
        )
        mm = ModuleManager(client)

        # Override methods to force specific logic in the module to happen
        mm.exit_json = Mock(return_value=True)
        mm.reset_device = Mock(return_value=True)
        mm.upload_to_device = Mock(return_value=True)
        mm.move_on_device = Mock(return_value=True)
        mm.merge_on_device = Mock(return_value=True)
        mm.remove_temporary_file = Mock(return_value=True)
        mm.save_on_device = Mock(return_value=True)

        results = mm.exec_module()

        assert results['changed'] is True