improvements, start integration tests

improved various funcs, removed extraneous things (e.g. Item.Attrs).

first integration test. more will come.
This commit is contained in:
2021-12-07 02:56:15 -05:00
parent 0fc0e0c269
commit b6ba0f9736
10 changed files with 70 additions and 31 deletions

View File

@@ -7,8 +7,6 @@ import (
`github.com/godbus/dbus/v5`
)
// TODO: add method Relabel
/*
NewCollection returns a pointer to a Collection based on a Service and a Dbus path.
You will almost always want to use Service.GetCollection instead.
@@ -188,6 +186,18 @@ func (c *Collection) Label() (label string, err error) {
return
}
// Relabel modifies the Collection's label in Dbus.
func (c *Collection) Relabel(newLabel string) (err error) {
var variant dbus.Variant = dbus.MakeVariant(newLabel)
if err = c.Dbus.SetProperty(DbusItemLabel, variant); err != nil {
return
}
return
}
// Created returns the time.Time of when a Collection was created.
func (c *Collection) Created() (created time.Time, err error) {