test

package
v0.0.0-...-453881e Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: MIT Imports: 12 Imported by: 2

README

Test class

If a test involves integrating with the filesystem, the network, or the database, it should go here. The converse is no tests that do those things should go anywhere else.

Tests in this folder are run one at a time, unless you specify t.Parallel(), which you can do if the test doesn't successfully write any state that could be read by any other test. HTTP requests can be made in parallel.

blank.go

Unfortunately godep can't build packages that contain only tests, hence the use of the blank.go file to trick Go.

Documentation

Overview

Copyright 2014 ISRG. All rights reserved This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copied from https://github.com/letsencrypt/boulder/blob/master/test/test-tools.go

See Q5 and Q11 here: https://www.mozilla.org/en-US/MPL/2.0/FAQ/ I think if we want to modify this file we have to release it publicly, otherwise we're fine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t testing.TB, result bool, message string)

Assert a boolean

func AssertBetween

func AssertBetween(t testing.TB, a, b, c int64)

AssertBetween determines if a is between b and c

func AssertBigIntEquals

func AssertBigIntEquals(t testing.TB, one *big.Int, two *big.Int)

AssertBigIntEquals uses the big.Int.cmp() method to measure whether one and two are equal

func AssertByteEquals

func AssertByteEquals(t testing.TB, one []byte, two []byte)

AssertByteEquals uses bytes.Equal to measure one and two for equality.

func AssertContains

func AssertContains(t testing.TB, haystack string, needle string)

AssertContains determines whether needle can be found in haystack

func AssertDeepEquals

func AssertDeepEquals(t testing.TB, one interface{}, two interface{})

AssertDeepEquals uses the reflect.DeepEqual method to measure one and two

func AssertEquals

func AssertEquals(t testing.TB, one interface{}, two interface{})

AssertEquals uses the equality operator (==) to measure one and two

func AssertError

func AssertError(t testing.TB, err error, message string)

AssertError checks that err is non-nil

func AssertIntEquals

func AssertIntEquals(t testing.TB, one int, two int)

AssertIntEquals uses the equality operator to measure one and two.

func AssertMarshaledEquals

func AssertMarshaledEquals(t testing.TB, one interface{}, two interface{})

AssertMarshaledEquals marshals one and two to JSON, and then uses the equality operator to measure them

func AssertNotContains

func AssertNotContains(t testing.TB, haystack string, needle string)

AssertNotContains determines if needle is not found in haystack

func AssertNotEquals

func AssertNotEquals(t testing.TB, one interface{}, two interface{})

AssertNotEquals uses the equality operator to measure that one and two are different

func AssertNotError

func AssertNotError(t testing.TB, err error, message string)

AssertNotError checks that err is nil

func AssertNotNil

func AssertNotNil(t testing.TB, obj interface{}, message string)

AssertNotNil checks an object to be non-nil

func AssertSeverity

func AssertSeverity(t testing.TB, data string, severity int)

AssertSeverity determines if a string matches the Severity formatting

func SetUp

func SetUp(t testing.TB)

func TearDown

func TearDown(t testing.TB)

TearDown deletes all records from the database, and marks the test as failed if this was unsuccessful.

func TruncateTables

func TruncateTables(t testing.TB) error

TruncateTables deletes all records from the database.

Types

This section is empty.

Directories

Path Synopsis
Integration tests for the archived_jobs table.
Integration tests for the archived_jobs table.
Tests for the jobs dequeuer.
Tests for the jobs dequeuer.
Package factory contains helpers for instantiating tests.
Package factory contains helpers for instantiating tests.
Integration tests for the queued_jobs table.
Integration tests for the queued_jobs table.
Tests for the jobs HTTP server.
Tests for the jobs HTTP server.

Jump to

Keyboard shortcuts

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