adding example and test information to readme.adoc

This commit is contained in:
2021-12-10 03:47:10 -05:00
parent 94ae20829e
commit 142c0ba74f
3 changed files with 146 additions and 3 deletions

View File

@@ -108,6 +108,7 @@ func TestService_CreateAliasedCollection(t *testing.T) {
collectionName.String(), collectionAlias.String(), err.Error(),
)
}
t.Logf("created collection '%v' at path '%v' successfully", collectionName.String(), string(collection.Dbus.Path()))
}
if err = svc.Close(); err != nil {
@@ -189,6 +190,8 @@ func TestService_Secrets(t *testing.T) {
t.Errorf("could not close Service.Session: %v", err.Error())
}
t.Fatalf("could not create collection '%v': %v", collectionName.String(), err.Error())
} else {
t.Logf("created collection '%v' at path '%v' successfully", collectionName.String(), string(collection.Dbus.Path()))
}
// Create a secret
@@ -280,6 +283,8 @@ func TestService_Locking(t *testing.T) {
t.Errorf("could not close Service.Session: %v", err.Error())
}
t.Errorf("could not create collection '%v': %v", collectionName.String(), err.Error())
} else {
t.Logf("created collection '%v' at path '%v' successfully", collectionName.String(), string(collection.Dbus.Path()))
}
if isLocked, err = collection.Locked(); err != nil {
@@ -327,4 +332,16 @@ func TestService_Locking(t *testing.T) {
collectionName.String(), stateChangeLock, isLocked,
)
}
// Delete the collection to clean up.
if err = collection.Delete(); err != nil {
t.Errorf(
"error when deleting collection '%v' when testing Service: %v",
collectionName.String(), err.Error(),
)
}
if err = svc.Close(); err != nil {
t.Errorf("could not close Service.Session: %v", err.Error())
}
}