From commits-return-1193-archive-asf-public=cust-asf.ponee.io@ponymail.incubator.apache.org Fri Jul 19 11:45:21 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 576C4180665 for ; Fri, 19 Jul 2019 13:45:21 +0200 (CEST) Received: (qmail 22717 invoked by uid 500); 19 Jul 2019 11:45:20 -0000 Mailing-List: contact commits-help@ponymail.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ponymail.incubator.apache.org Delivered-To: mailing list commits@ponymail.incubator.apache.org Received: (qmail 22708 invoked by uid 99); 19 Jul 2019 11:45:20 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jul 2019 11:45:20 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 76B0985E2E; Fri, 19 Jul 2019 11:45:20 +0000 (UTC) Date: Fri, 19 Jul 2019 11:45:20 +0000 To: "commits@ponymail.apache.org" Subject: [incubator-ponymail] branch master updated: Add basic mock functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <156353672043.29223.10710198211629756526@gitbox.apache.org> From: sebb@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-ponymail X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: dd1fd9ed62c78fd866c418dfe60487ee5cade6c8 X-Git-Newrev: cdd277c257473e3fa937dd6e3db101bcfd12cb82 X-Git-Rev: cdd277c257473e3fa937dd6e3db101bcfd12cb82 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git The following commit(s) were added to refs/heads/master by this push: new cdd277c Add basic mock functions cdd277c is described below commit cdd277c257473e3fa937dd6e3db101bcfd12cb82 Author: Sebb AuthorDate: Fri Jul 19 12:45:11 2019 +0100 Add basic mock functions --- test/mock_r.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/mock_r.lua b/test/mock_r.lua new file mode 100644 index 0000000..7a2f96b --- /dev/null +++ b/test/mock_r.lua @@ -0,0 +1,30 @@ +-- Mock version of various items for testing + +local _M = {} + +local r = { + puts = function(r, ...) print(...) end, + getcookie = function(r, name) return nil end, + strcmp_match = function(str, pat) + pat = pat:gsub("%.", "%%."):gsub("*", ".+") + return str:match(pat) + end, + ivm_set = function(r, key, val) _M['ivm_' .. key] = val end, + ivm_get = function(r, key) return _M['ivm_' .. key] end, +} + +local function account(uid) + return { + credentials = { + uid = uid, + }, + internal = { + oauth_used = 'localhost', + }, + } +end + +return { + r = r, + account = account +}