Hardening mock generator with a few more tests

Signed-off-by: Quobix <dave@quobix.com>
This commit is contained in:
Quobix
2023-08-30 06:27:57 -04:00
committed by quobix
parent 9fb09f3a42
commit 2ddc147906
2 changed files with 49 additions and 2 deletions

View File

@@ -92,8 +92,6 @@ func (mg *MockGenerator) GenerateMock(mock any, name string) ([]byte, error) {
// check if this is a SchemaProxy, if not, then see if it has a Schema, if not, then we can't generate a mock.
var schemaValue *highbase.Schema
switch reflect.TypeOf(mock) {
case reflect.TypeOf(&highbase.SchemaProxy{}):
schemaValue = mock.(*highbase.SchemaProxy).Schema()
case reflect.TypeOf(&highbase.Schema{}):
schemaValue = mock.(*highbase.Schema)
default: