We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e47227d commit 48c72f1Copy full SHA for 48c72f1
dbus/methods_test.go
@@ -138,3 +138,18 @@ func TestGetUnitProperties(t *testing.T) {
138
t.Fatal("unexpected wants for /")
139
}
140
141
+
142
+// TestGetUnitPropertiesRejectsInvalidName attempts to get the properties for a
143
+// unit with an invalid name. This test should be run with --test.timeout set,
144
+// as a fail will manifest as GetUnitProperties hanging indefinitely.
145
+func TestGetUnitPropertiesRejectsInvalidName(t *testing.T) {
146
+ conn := setupConn(t)
147
148
+ unit := "//invalid#$^/"
149
150
+ _, err := conn.GetUnitProperties(unit)
151
152
+ if err == nil {
153
+ t.Fatal("Expected an error, got nil")
154
+ }
155
+}
0 commit comments