test

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanTempTestFiles

func CleanTempTestFiles(t *testing.T, temp string)

CleanTempTestFiles removes a specific folder and all its contents from disk

func CompareGraphOutputAsSets

func CompareGraphOutputAsSets(expected, produced string) bool

CompareGraphOutputAsSets - the graphviz library does not always output the result string with nodes and edges in the same order (it can vary between calls). This does not impact using the result but makes testing the result a headache as the assumption is that the expected string and the produced string would match exactly. When the sequence changes they dont match. This function converts the strings into sets of lines and compares if the lines in the two outputs are the same

func ExecuteCommand

func ExecuteCommand(root *cobra.Command, args ...string) (output string, err error)

ExecuteCommand is used to run a cobra command with arguments and return its value and error

func GetAllLogs

func GetAllLogs(logs []*logrus.Entry) (entries []string)

GetAllLogs loops through logrus entries and returns messages as []string

func PrepareRealFilesForTest

func PrepareRealFilesForTest(t *testing.T) (string, string, string)

PrepareRealFilesForTest creates a new temporary folder with new map and constellation files. Returns path to new temp folder

func PrepareTwoRealConstellationFilesForTest

func PrepareTwoRealConstellationFilesForTest(t *testing.T) (string, string, string, string)

PrepareTwoRealConstellationFilesForTest - this use the two required for the diff command

Types

This section is empty.

Jump to

Keyboard shortcuts

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