tests

package
v0.0.0-...-c937b9e Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Tests package contains different helpers for testing purposes

Index

Constants

View Source
const TestDbPrefix = "test_"

Variables

This section is empty.

Functions

func PrepareTestDb

func PrepareTestDb(addr string) (*mgo.Session, error)

Connect to mongo using addr, which must contain db name (mongodb://localhost/test_NAME) Be careful, database will be dropped.

func RandomTestMongoDown

func RandomTestMongoDown(session *mgo.Session, dbName string)

Remove testing database and close session

func RandomTestMongoUp

func RandomTestMongoUp() (*mgo.Session, string, error)

Create db with randomly generated name. Returns session and database name

Types

This section is empty.

Jump to

Keyboard shortcuts

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