-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for Sync & Discover mode #7
Conversation
cmd/internal/discover_test.go
Outdated
emp := c.Streams[0] | ||
mm := emp.Metadata.GetPropertyMap() | ||
assert.Equal(t, "automatic", mm["emp_no"].Metadata.Inclusion, "key properties should be auto-included") | ||
assert.Equal(t, mm["emp_no"].Metadata.BreadCrumb, []string{"properties", "emp_no"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you start to get into big nested comparisons like this, it gets easy to gloss over the details. It may be easier to compare a full "want" map versus the "got" result from GetPropertyMap so that the test libraries can spit out a nice diff of the whole thing rather than making assertions on each key/value pair.
cmd/internal/sync.go
Outdated
if err != nil { | ||
return err | ||
} | ||
|
||
if newCursor != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implies that it's possible for Read to return nil, nil above? Is that an expected behavior? Generally I'd expect some sort of sentinel value or error instead.
Co-authored-by: Matt Layher <mdlayher@gmail.com>
Adds tests for the
Sync
andDiscover
mode in the CLI