test

package
v0.0.0-...-643f1d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dummy_Org = map[string]interface{}{
	"id":         1,
	"created_at": time.Now(),
	"updated_at": time.Now(),
	"deleted_at": nil,
	"title":      "test org",
	"slug":       "test-org",
	"permission": map[string]interface{}{
		"id":              1,
		"created_at":      time.Now(),
		"updated_at":      time.Now(),
		"deleted_at":      nil,
		"user_id":         1,
		"user":            nil,
		"organisation_id": 1,
		"organisation":    nil,
		"role":            "owner",
	},
}
View Source
var Dummy_OrgList = []map[string]interface{}{
	Dummy_Org,
}
View Source
var Dummy_SinglePolicy = map[string]interface{}{
	"id":          "app:mande:superorg",
	"description": "",
	"subjects": []string{
		"1",
	},
	"resources": []string{
		"resources:org:1:<.*>",
	},
	"actions": []string{
		"actions:org:1:<.*>",
	},
	"effect":     "allow",
	"conditions": nil,
}
View Source
var MeiliHits = map[string]interface{}{
	"hits": []map[string]interface{}{
		{
			"object_id":   "format_2",
			"kind":        "format",
			"id":          2,
			"description": "This is a test format",
			"name":        "Test Format",
			"is_default":  true,
		},
		{
			"object_id":   "format_3",
			"kind":        "format",
			"id":          3,
			"description": "This is second test format",
			"name":        "Test format 2",
			"is_default":  true,
		},
		{
			"object_id": "tag_2",
			"kind":      "tag",
			"id":        2,
			"slug":      "test-tag",
			"title":     "Test tag",
		},
	},
	"offset":           0,
	"limit":            10,
	"nbHits":           10,
	"exhaustiveNbHits": false,
	"processingTimeMs": 2,
	"query":            "test",
}
View Source
var RazorpayOrder = map[string]interface{}{
	"id":          "order_FltCdu23fGaTwG",
	"entity":      "order",
	"amount":      5000,
	"amount_paid": 0,
	"amount_due":  5000,
	"currency":    "INR",
	"receipt":     "Test Receipt no. 1",
	"offer_id":    nil,
	"status":      "created",
	"attempts":    0,
	"notes": map[string]interface{}{
		"info": "this payment is for first order",
	},
	"created_at": 1602047090,
}
View Source
var RazorpayPayment = map[string]interface{}{
	"id":              "pay_FjYWQFwuiE89Xp",
	"entity":          "payment",
	"amount":          10000,
	"currency":        "INR",
	"status":          "captured",
	"order_id":        "order_FjYVOJ8Vod4lmT",
	"invoice_id":      nil,
	"international":   false,
	"method":          "card",
	"amount_refunded": 0,
	"refund_status":   nil,
	"captured":        true,
	"description":     "Test Transaction",
	"card_id":         "card_FjYNqO7cTrB4EU",
	"bank":            nil,
	"wallet":          nil,
	"vpa":             nil,
	"email":           "gaurav.kumar@example.com",
	"contact":         "+919999999999",
	"notes": map[string]interface{}{
		"address": "Razorpay Corporate Office",
	},
	"fee":               2798,
	"tax":               0,
	"error_code":        nil,
	"error_description": nil,
	"error_source":      nil,
	"error_step":        nil,
	"error_reason":      nil,
	"acquirer_data": map[string]interface{}{
		"auth_code": "464641",
	},
	"created_at": 1601889873,
}
View Source
var ReturnUpdate = map[string]interface{}{
	"updateId": 1,
}

Functions

func ExpectationsMet

func ExpectationsMet(t *testing.T, mock sqlmock.Sqlmock)

ExpectationsMet checks if all the expectations are fulfilled

func KavachGock

func KavachGock()

KavachGock Mock server for kavach-server

func KetoGock

func KetoGock()

KetoGock Mock server for keto

func MeiliGock

func MeiliGock()

func RazorpayGock

func RazorpayGock()

func SetupMockDB

func SetupMockDB() sqlmock.Sqlmock

SetupMockDB setups the mock sql db

Types

type AnyTime

type AnyTime struct{}

AnyTime To match time for test sqlmock queries

func (AnyTime) Match

func (a AnyTime) Match(v driver.Value) bool

Match satisfies sqlmock.Argument interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL