Fix unit tests

This commit is contained in:
Olivier Tremblay 2017-10-20 19:16:24 -04:00
parent 788e7fd40c
commit 78c07fde17
No known key found for this signature in database
GPG key ID: D1C73ACB855E3A6D
2 changed files with 1 additions and 24 deletions

View file

@ -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)

View file

@ -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
} }