From 8778a2e9d6bb3d058f857381550419dbd369c511 Mon Sep 17 00:00:00 2001 From: eenblam Date: Fri, 31 Aug 2018 14:07:47 -0700 Subject: [PATCH] Add iwlist freq test case --- network/net_linux_test.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/network/net_linux_test.go b/network/net_linux_test.go index 55713b0e..01fa3f4e 100644 --- a/network/net_linux_test.go +++ b/network/net_linux_test.go @@ -15,9 +15,28 @@ func TestProcessSupportedFrequencies(t *testing.T) { ExpectedFreqs []int ExpectedError bool }{ + { + "Returns appropriately formatted frequencies on valid input", + `wlan1 11 channels in total; available frequencies : + Channel 01 : 2.412 GHz + Channel 02 : 2.417 GHz + Channel 03 : 2.422 GHz + Channel 04 : 2.427 GHz + Channel 05 : 2.432 GHz + Channel 06 : 2.437 GHz + Channel 07 : 2.442 GHz + Channel 08 : 2.447 GHz + Channel 09 : 2.452 GHz + Channel 10 : 2.457 GHz + Channel 11 : 2.462 GHz + Current Frequency:2.437 GHz (Channel 6)`, + nil, + []int{2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462}, + false, + }, { "Returns empty with an error", - "Shouldn't matter", + "Doesn't matter", errors.New("iwlist must have failed"), []int{}, true,