Ejemplo n.º 1
0
// NewMockTileStoreFromJson reads a tile that has been serialized to JSON
// and wraps an instance of MockTileStore around it.
func NewMockTileStoreFromJson(t assert.TestingT, fname string) tiling.TileStore {
	f, err := os.Open(fname)
	assert.Nil(t, err)

	tile, err := types.TileFromJson(f, &types.GoldenTrace{})
	assert.Nil(t, err)

	return &MockTileStore{
		t:    t,
		tile: tile,
	}
}
Ejemplo n.º 2
0
// NewMockTileStoreFromJson reads a tile that has been serialized to JSON
// and wraps an instance of MockTileStore around it.
func NewMockTileBuilderFromJson(t assert.TestingT, fname string) tracedb.MasterTileBuilder {
	f, err := os.Open(fname)
	assert.Nil(t, err)

	tile, err := types.TileFromJson(f, &types.GoldenTrace{})
	assert.Nil(t, err)

	return &MockTileBuilder{
		t:    t,
		tile: tile,
	}
}