diff options
| author | Pawel Stolowski <stolowski@gmail.com> | 2018-10-11 14:55:44 +0200 |
|---|---|---|
| committer | Pawel Stolowski <stolowski@gmail.com> | 2018-10-11 14:55:44 +0200 |
| commit | b0576d881bd4fa2647fed7c04210513472e269a1 (patch) | |
| tree | 8d341e9ffd5b93ed3b97a5d3184993f93507d726 | |
| parent | e6d3a6b7b51ad40cfdee082f0280b5d20dd7076e (diff) | |
Used TestInterface for AllHotplugInterfaces test.repo-test-cleanup
| -rw-r--r-- | interfaces/repo_test.go | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/interfaces/repo_test.go b/interfaces/repo_test.go index 195672e009..5b9b61eab9 100644 --- a/interfaces/repo_test.go +++ b/interfaces/repo_test.go @@ -25,7 +25,6 @@ import ( . "gopkg.in/check.v1" . "github.com/snapcore/snapd/interfaces" - "github.com/snapcore/snapd/interfaces/hotplug" "github.com/snapcore/snapd/interfaces/ifacetest" "github.com/snapcore/snapd/snap" "github.com/snapcore/snapd/snap/snaptest" @@ -2408,25 +2407,11 @@ func (s *RepositorySuite) TestConnectWithStaticAttrs(c *C) { c.Assert(conn.Slot.StaticAttrs(), DeepEquals, slotAttrs) } -type hotplugTestInterface struct{ InterfaceName string } - -func (h *hotplugTestInterface) Name() string { - return h.InterfaceName -} - -func (h *hotplugTestInterface) AutoConnect(plug *snap.PlugInfo, slot *snap.SlotInfo) bool { - return true -} - -func (h *hotplugTestInterface) HotplugDeviceDetected(di *hotplug.HotplugDeviceInfo, spec *hotplug.Specification) error { - return nil -} - func (s *RepositorySuite) TestAllHotplugInterfaces(c *C) { repo := NewRepository() c.Assert(repo.AddInterface(&ifacetest.TestInterface{InterfaceName: "iface1"}), IsNil) - c.Assert(repo.AddInterface(&hotplugTestInterface{InterfaceName: "iface2"}), IsNil) - c.Assert(repo.AddInterface(&hotplugTestInterface{InterfaceName: "iface3"}), IsNil) + c.Assert(repo.AddInterface(&ifacetest.TestHotplugInterface{TestInterface: ifacetest.TestInterface{InterfaceName: "iface2"}}), IsNil) + c.Assert(repo.AddInterface(&ifacetest.TestHotplugInterface{TestInterface: ifacetest.TestInterface{InterfaceName: "iface3"}}), IsNil) hi := repo.AllHotplugInterfaces() c.Assert(hi, HasLen, 2) |
