refactor: move ooni into the internal package (#168)
With this commit we've reorganised the package structure. Now I will go more in depth and perform further refactoring.
This commit is contained in:
parent
bc85efa6e5
commit
c81393b31a
7 changed files with 5 additions and 5 deletions
29
internal/ooni/ooni_test.go
Normal file
29
internal/ooni/ooni_test.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package ooni
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInit(t *testing.T) {
|
||||
ooniHome, err := ioutil.TempDir("", "oonihome")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(ooniHome)
|
||||
|
||||
ctx := NewContext("", ooniHome)
|
||||
swName := "ooniprobe-cli-tests"
|
||||
swVersion := "3.0.0-alpha"
|
||||
if err := ctx.Init(swName, swVersion); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal("failed to init the context")
|
||||
}
|
||||
|
||||
configPath := path.Join(ooniHome, "config.json")
|
||||
if _, err := os.Stat(configPath); os.IsNotExist(err) {
|
||||
t.Fatal("config file was not created")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue