all: Hide implementations behind interfaces for mocked testing (#5548)
* lib/model: Hide implementations behind interfaces for mocked testing * review
This commit is contained in:
committed by
Audrius Butkevicius
parent
8a05492622
commit
722b3fce6a
@@ -93,7 +93,7 @@ func TestDeviceConfig(t *testing.T) {
|
||||
t.Fatal("Unexpected file")
|
||||
}
|
||||
|
||||
cfg := wr.cfg
|
||||
cfg := wr.(*wrapper).cfg
|
||||
|
||||
expectedFolders := []FolderConfiguration{
|
||||
{
|
||||
@@ -515,7 +515,7 @@ func TestNewSaveLoad(t *testing.T) {
|
||||
cfg := Wrap(path, intCfg)
|
||||
|
||||
// To make the equality pass later
|
||||
cfg.cfg.XMLName.Local = "configuration"
|
||||
cfg.(*wrapper).cfg.XMLName.Local = "configuration"
|
||||
|
||||
if exists(path) {
|
||||
t.Error(path, "exists")
|
||||
@@ -827,7 +827,7 @@ func TestIgnoredFolders(t *testing.T) {
|
||||
|
||||
// 2 for folder2, 1 for folder1, as non-existing device and device the folder is shared with is removed.
|
||||
expectedIgnoredFolders := 3
|
||||
for _, dev := range wrapper.cfg.Devices {
|
||||
for _, dev := range wrapper.Devices() {
|
||||
expectedIgnoredFolders -= len(dev.IgnoredFolders)
|
||||
}
|
||||
if expectedIgnoredFolders != 0 {
|
||||
|
||||
Reference in New Issue
Block a user