Fix unit tests
This commit is contained in:
parent
788e7fd40c
commit
78c07fde17
2 changed files with 1 additions and 24 deletions
|
|
@ -12,7 +12,7 @@ hell
|
||||||
Issue Type: Sometype
|
Issue Type: Sometype
|
||||||
this is ignored
|
this is ignored
|
||||||
Summary: Dookienator
|
Summary: Dookienator
|
||||||
also ignored`, "\n"))
|
also ignored`, "\n"), nil)
|
||||||
AssertEqual(t, `Cowboys
|
AssertEqual(t, `Cowboys
|
||||||
from
|
from
|
||||||
hell`, iss.Fields.Description)
|
hell`, iss.Fields.Description)
|
||||||
|
|
|
||||||
23
jkl_test.go
23
jkl_test.go
|
|
@ -1,34 +1,11 @@
|
||||||
package jkl
|
package jkl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"text/template"
|
"text/template"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestUnmarshalProjects(t *testing.T) {
|
|
||||||
f, err := os.Open("projects.json")
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
dec := json.NewDecoder(f)
|
|
||||||
x := struct{ Projects []Project }{}
|
|
||||||
|
|
||||||
err = dec.Decode(&x)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
for _, p := range x.Projects {
|
|
||||||
for _, it := range p.IssueTypes {
|
|
||||||
for sn, f := range it.Fields {
|
|
||||||
fmt.Println(it.Name, sn, f.Name, f.Required, f.Schema.Type)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type TestType struct {
|
type TestType struct {
|
||||||
Field string
|
Field string
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue