Skip to content

Commit

Permalink
Update construct graph unit tests to new graph behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
gordon-klotho committed Sep 21, 2023
1 parent 37fe32d commit a4f5be9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/construct/construct_graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package construct
import (
"testing"

orig_graph "github.com/dominikbraun/graph"
"github.com/klothoplatform/klotho/pkg/annotation"
"github.com/klothoplatform/klotho/pkg/graph"
"github.com/stretchr/testify/assert"
Expand All @@ -20,6 +21,8 @@ func (tc *TestConstruct) Id() ResourceId {
}
}

var emptyProperties = orig_graph.EdgeProperties{Attributes: make(map[string]string)}

func Test_AddConstruct(t *testing.T) {
assert := assert.New(t)
g := graph.NewDirected(construct2Hash)
Expand Down Expand Up @@ -124,6 +127,7 @@ func Test_GetDownstreamDependencies(t *testing.T) {
{
Source: &TestConstruct{Name: "testkv"},
Destination: &TestConstruct{Name: "testeu"},
Properties: emptyProperties,
},
},
},
Expand All @@ -138,10 +142,12 @@ func Test_GetDownstreamDependencies(t *testing.T) {
{
Source: &TestConstruct{Name: "test"},
Destination: &TestConstruct{Name: "test1"},
Properties: emptyProperties,
},
{
Source: &TestConstruct{Name: "test"},
Destination: &TestConstruct{Name: "test2"},
Properties: emptyProperties,
},
},
},
Expand Down Expand Up @@ -194,6 +200,7 @@ func Test_GetUpstreamDependencies(t *testing.T) {
{
Source: &TestConstruct{Name: "test1"},
Destination: &TestConstruct{Name: "test"},
Properties: emptyProperties,
},
},
},
Expand All @@ -208,10 +215,12 @@ func Test_GetUpstreamDependencies(t *testing.T) {
{
Source: &TestConstruct{Name: "test1"},
Destination: &TestConstruct{Name: "test"},
Properties: emptyProperties,
},
{
Source: &TestConstruct{Name: "test2"},
Destination: &TestConstruct{Name: "test"},
Properties: emptyProperties,
},
},
},
Expand Down

0 comments on commit a4f5be9

Please sign in to comment.