Skip to content

Commit fc1e33f

Browse files
committed
bumped code
1 parent c208e5f commit fc1e33f

4 files changed

Lines changed: 23 additions & 0 deletions

File tree

datamodel/low/v3/oauth_flows_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ scopes:
225225

226226
// hash
227227
assert.Equal(t, n.Hash(), n2.Hash())
228+
assert.NotNil(t, n2.GetContext())
229+
assert.NotNil(t, n2.GetIndex())
230+
228231
}
229232

230233
func TestOAuthFlows_Hash(t *testing.T) {

datamodel/low/v3/paths_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ x-milk: cold`
5555
assert.NoError(t, err)
5656
assert.NotNil(t, n.GetRootNode())
5757
assert.Nil(t, n.GetKeyNode())
58+
assert.NotNil(t, n.GetIndex())
59+
assert.NotNil(t, n.GetContext())
5860

5961
path := n.FindPath("/some/path").Value
6062
assert.NotNil(t, path)

datamodel/low/v3/security_scheme_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ x-milk: please`
8181
assert.Equal(t, "please", xMilk)
8282
assert.Equal(t, "https://pb33f.io", n.Flows.Value.Implicit.Value.TokenUrl.Value)
8383
assert.Equal(t, 1, orderedmap.Len(n.GetExtensions()))
84+
assert.NotNil(t, n.GetContext())
85+
assert.NotNil(t, n.GetIndex())
8486
}
8587

8688
func TestSecurityScheme_Build_Fail(t *testing.T) {

renderer/mock_generator_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,22 @@ properties:
412412
assert.Equal(t, "perhaps the best cyberpunk movie ever made.", m["description"].(string))
413413
}
414414

415+
func TestMockGenerator_EmptyMock(t *testing.T) {
416+
417+
mg := NewMockGenerator(YAML)
418+
419+
sp := &lowbase.SchemaProxy{}
420+
sp.Build(context.Background(), &yaml.Node{}, &yaml.Node{}, nil)
421+
422+
mock, err := mg.GenerateMock(&fakeMockable{
423+
Schema: base.NewSchemaProxy(&low.NodeReference[*lowbase.SchemaProxy]{Value: sp}),
424+
Example: nil,
425+
Examples: nil,
426+
}, "")
427+
assert.Error(t, err)
428+
assert.Nil(t, mock)
429+
}
430+
415431
func TestMockGenerator_GeneratePropertyExamples(t *testing.T) {
416432
fake := createFakeMock(`type: object
417433
required:

0 commit comments

Comments
 (0)