refactor: move more commands to internal/cmd (#207)
* refactor: move more commands to internal/cmd Part of https://github.com/ooni/probe/issues/1335. We would like all commands to be at the same level of engine rather than inside engine (now that we can do it). * fix: update .gitignore * refactor: also move jafar outside engine * We should be good now?
This commit is contained in:
parent
6351d898d6
commit
4eeadd06a5
85 changed files with 72 additions and 65 deletions
|
|
@ -1,39 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func init() {
|
||||
*reportid = `20201209T052225Z_urlgetter_IT_30722_n1_E1VUhMz08SEkgYFU`
|
||||
*input = `https://www.example.org`
|
||||
}
|
||||
|
||||
func TestCheck(t *testing.T) {
|
||||
*mode = "check"
|
||||
main()
|
||||
}
|
||||
|
||||
func TestRaw(t *testing.T) {
|
||||
*mode = "raw"
|
||||
main()
|
||||
}
|
||||
|
||||
func TestMeta(t *testing.T) {
|
||||
*mode = "meta"
|
||||
main()
|
||||
}
|
||||
|
||||
func TestInvalidMode(t *testing.T) {
|
||||
defer func() {
|
||||
if recover() == nil {
|
||||
t.Fatal("the code did not panic")
|
||||
}
|
||||
}()
|
||||
osExit = func(code int) {
|
||||
panic(fmt.Errorf("%d", code))
|
||||
}
|
||||
*mode = "antani"
|
||||
main()
|
||||
}
|
||||
Loading…
Reference in a new issue