Add test for loadLabels function
This commit is contained in:
parent
d63f4ec09f
commit
e66f795783
1 changed files with 21 additions and 0 deletions
|
@ -144,6 +144,27 @@ func TestTensorFlow_Labels(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTensorFlow_LoadLabels(t *testing.T) {
|
||||||
|
t.Run("labels.txt exists", func(t *testing.T) {
|
||||||
|
conf := config.NewTestConfig()
|
||||||
|
|
||||||
|
tensorFlow := NewTensorFlow(conf)
|
||||||
|
path := conf.TensorFlowModelPath()
|
||||||
|
|
||||||
|
result := tensorFlow.loadLabels(path)
|
||||||
|
assert.Nil(t, result)
|
||||||
|
})
|
||||||
|
t.Run("label.txt does not exist", func(t *testing.T) {
|
||||||
|
conf := config.NewTestErrorConfig()
|
||||||
|
|
||||||
|
tensorFlow := NewTensorFlow(conf)
|
||||||
|
path := conf.TensorFlowModelPath()
|
||||||
|
|
||||||
|
result := tensorFlow.loadLabels(path)
|
||||||
|
assert.Contains(t, result.Error(), "no such file or directory")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func TestTensorFlow_LoadModel(t *testing.T) {
|
func TestTensorFlow_LoadModel(t *testing.T) {
|
||||||
t.Run("model path exists", func(t *testing.T) {
|
t.Run("model path exists", func(t *testing.T) {
|
||||||
conf := config.NewTestConfig()
|
conf := config.NewTestConfig()
|
||||||
|
|
Loading…
Reference in a new issue