Skip to content

Commit

Permalink
Merge pull request canonical#9431 from zyga/tweak/desktop-notificatio…
Browse files Browse the repository at this point in the history
…n-tests

desktop/notification: add unit tests
  • Loading branch information
zyga authored Sep 30, 2020
2 parents 5c91715 + 37ebd5e commit e242a28
Show file tree
Hide file tree
Showing 5 changed files with 781 additions and 2 deletions.
24 changes: 24 additions & 0 deletions desktop/notification/export_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// -*- Mode: Go; indent-tabs-mode: t -*-

/*
* Copyright (C) 2020 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

package notification

var (
ProcessSignal = processSignal
)
5 changes: 3 additions & 2 deletions desktop/notification/fdo.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ package notification
import (
"context"
"fmt"
"log"

"github.com/godbus/dbus"

"github.com/snapcore/snapd/logger"
)

const (
Expand Down Expand Up @@ -136,7 +137,7 @@ func (srv *Server) ObserveNotifications(ctx context.Context, observer Observer)
// to clobber the actual error being returned from the function in
// general, so ignore RemoveMatchSignal errors and just log them
// instead.
log.Print("Cannot remove D-Bus signal matcher:", err)
logger.Noticef("Cannot remove D-Bus signal matcher: %v", err)
}
}()

Expand Down
Loading

0 comments on commit e242a28

Please sign in to comment.