Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
babos77 committed Sep 15, 2021
2 parents f5dc3fb + 2d74c8d commit 846e064
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/communicator/deviceclass/device_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ type yamlComponentsOID struct {

// GetHierarchy returns the hierarchy of device classes merged with their corresponding code communicator.
func GetHierarchy() (hierarchy.Hierarchy, error) {
genericDeviceClassDir := "device-classes"
genericDeviceClassDir := "deviceclass"
genericDeviceClassFile, err := config.FileSystem.Open(filepath.Join(genericDeviceClassDir, "generic.yaml"))
if err != nil {
return hierarchy.Hierarchy{}, errors.Wrap(err, "failed to open generic device class file")
Expand Down
11 changes: 11 additions & 0 deletions internal/communicator/deviceclass/device_class_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package deviceclass

import (
"github.com/stretchr/testify/assert"
"testing"
)

func TestDeviceClass_GetHierarchy(t *testing.T) {
_, err := GetHierarchy()
assert.NoError(t, err, "hierarchy building failed")
}
2 changes: 1 addition & 1 deletion internal/mapping/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (m mapping) get(key string) (string, error) {
}

func readMapping(file string) (mapping, error) {
f, err := config.FileSystem.Open(filepath.Join("mappings", file))
f, err := config.FileSystem.Open(filepath.Join("mapping", file))
if err != nil {
return nil, errors.New("failed to open mappings file")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/mapping/mappings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func TestMappings(t *testing.T) {
fileName := "ifType.yaml"
f, err := config.FileSystem.Open(filepath.Join("mappings", fileName))
f, err := config.FileSystem.Open(filepath.Join("mapping", fileName))
if !assert.NoError(t, err, "failed to open mappings file from virtual file system") {
return
}
Expand Down

0 comments on commit 846e064

Please sign in to comment.