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
|
||||
this is ignored
|
||||
Summary: Dookienator
|
||||
also ignored`, "\n"))
|
||||
also ignored`, "\n"), nil)
|
||||
AssertEqual(t, `Cowboys
|
||||
from
|
||||
hell`, iss.Fields.Description)
|
||||
|
|
|
|||
23
jkl_test.go
23
jkl_test.go
|
|
@ -1,34 +1,11 @@
|
|||
package jkl
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
"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 {
|
||||
Field string
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue