file_test.go 400 Bytes
Newer Older
Loïck Bonniot's avatar
Loïck Bonniot committed
1 2 3 4 5 6
package common

import (
	"io/ioutil"
	"testing"

7
	"github.com/stretchr/testify/assert"
Loïck Bonniot's avatar
Loïck Bonniot committed
8 9 10 11 12 13 14 15 16 17 18
)

func TestUnmarshalDFSSFile(t *testing.T) {
	data, err := ioutil.ReadFile("../testdata/file.dfss")
	assert.Equal(t, nil, err)

	c, err := UnmarshalDFSSFile(data)
	assert.Equal(t, nil, err)
	assert.Equal(t, "filename.pdf", c.File.Name)
	// a tiny test, full unmarshal is tested in dfss/dfssp/contract package
}