lib.hemtjan.st: lib.hemtjan.st/testutils Index | Files

package testutils

import "lib.hemtjan.st/testutils"

Index

Package Files

utils.go

func DevicesFromJSON Uses

func DevicesFromJSON(path string, m device.Transport) (func(), error)

DevicesFromJSON creates fake devices on the broker based on the devices defined in a JSON file When you run the returned cleanup function it will delete the devices. Note that unless you then also close the transport it might still announce the device(s) when it receives a discover.

func MQTTAddress Uses

func MQTTAddress(t *testing.T) string

MQTTAddress is a helper function that will try to connect to an MQTT broker on MQTT_ADDRESS and if successful return the address. It should only be used in Bibliotek's own tests or other Hemtjanst component tests

Package testutils imports 10 packages (graph). Updated 2019-07-19. Refresh now. Tools for package owners.