From 60ac9b7400cdcf0ceeacfe0c6c3d55585a6a9daa Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Sun, 16 May 2021 22:36:11 -0700 Subject: [PATCH] finishes IsActive tests --- systemctl_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/systemctl_test.go b/systemctl_test.go index 7b403ab..a0072d8 100644 --- a/systemctl_test.go +++ b/systemctl_test.go @@ -178,6 +178,15 @@ func TestIsActive(t *testing.T) { } Unmask(ctx, unit, Options{UserMode: false}) }) + t.Run(fmt.Sprintf("check masked"), func(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) + defer cancel() + _, err := IsActive(ctx, "nonexistant", Options{UserMode: false}) + if err != nil { + t.Errorf("error is %v, but should have been %v", err, ErrDoesNotExist) + } + }) + } // Runs through all defined Properties in parallel and checks for error cases