From b647c761f3a40e47db1c54a97a959cdf70bcaa96 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 30 Sep 2020 13:08:44 +0200 Subject: [PATCH] Test loading the configuration --- main_test.go | 27 +++++++++++++++++++++++++++ stream/multicast/multicast_test.go | 1 + 2 files changed, 28 insertions(+) create mode 100644 stream/multicast/multicast_test.go diff --git a/main_test.go b/main_test.go index 06ab7d0..7650bd7 100644 --- a/main_test.go +++ b/main_test.go @@ -1 +1,28 @@ package main + +import ( + "github.com/spf13/viper" + "gitlab.crans.org/nounous/ghostream/auth" + "gitlab.crans.org/nounous/ghostream/internal/monitoring" + "gitlab.crans.org/nounous/ghostream/stream/multicast" + "gitlab.crans.org/nounous/ghostream/stream/srt" + "gitlab.crans.org/nounous/ghostream/stream/webrtc" + "gitlab.crans.org/nounous/ghostream/web" + "testing" +) + +// TestLoadConfiguration tests the configuration file loading and the init of some parameters +func TestLoadConfiguration(t *testing.T) { + loadConfiguration() + cfg := struct { + Auth auth.Options + Monitoring monitoring.Options + Multicast multicast.Options + Srt srt.Options + Web web.Options + WebRTC webrtc.Options + }{} + if err := viper.Unmarshal(&cfg); err != nil { + t.Fatal("Failed to load settings", err) + } +} diff --git a/stream/multicast/multicast_test.go b/stream/multicast/multicast_test.go new file mode 100644 index 0000000..aa01d64 --- /dev/null +++ b/stream/multicast/multicast_test.go @@ -0,0 +1 @@ +package multicast