testutils

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

* Copyright 2019-present Open Networking Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (
	CONTAINER_NAME = "xos-mock-grpc-server"
)

Variables

View Source
var MockDir = os.Getenv("CORDCTL_MOCK_DIR")

Functions

func AssertErrorEqual

func AssertErrorEqual(t *testing.T, err error, expected string) error

Assert that the error string is what we expect

func AssertJSONEqual

func AssertJSONEqual(t *testing.T, actual string, expected string) error

Assert that two JSON-encoded strings are equal

func AssertStringEqual

func AssertStringEqual(t *testing.T, actual string, expected string) error

func IsReady

func IsReady() (bool, error)

Return true if the mock server is ready

func StartMockServer

func StartMockServer(data_name string) error

Start the mock server and wait for it to be ready

`data_name` is the name of the data.json to tell the mock server to use.
If a mock server is already running with the same data_name, it is not restarted.

func StopMockServer

func StopMockServer() error

Stop the mock server

func WaitForReady

func WaitForReady() error

Wait for the mock server to be ready

Types

This section is empty.

Jump to

Keyboard shortcuts

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