-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02b4937
commit 2b67d20
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package mysql | ||
|
||
import ( | ||
"context" | ||
"os" | ||
"testing" | ||
|
||
"github.com/micromdm/nanomdm/storage/test" | ||
) | ||
|
||
func TestRetrievePushInfo(t *testing.T) { | ||
testDSN := os.Getenv("NANOMDM_MYSQL_STORAGE_TEST_DSN") | ||
if testDSN == "" { | ||
t.Skip("NANOMDM_MYSQL_STORAGE_TEST_DSN not set") | ||
} | ||
|
||
storage, err := New(WithDSN(testDSN), WithDeleteCommands()) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
test.TestRetrievePushInfo(t, context.Background(), storage) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/micromdm/nanomdm/storage" | ||
) | ||
|
||
func TestRetrievePushInfo(t *testing.T, ctx context.Context, s storage.PushStore) { | ||
t.Run("TestRetrievePushInfo", func(t *testing.T) { | ||
_, err := s.RetrievePushInfo(ctx, []string{"INVALID"}) | ||
if err != nil { | ||
// should NOT recieve a "global" error for an enrollment that | ||
// is merely invalid (or not enrolled yet, or not fully enrolled) | ||
t.Errorf("should NOT have errored: %v", err) | ||
} | ||
}) | ||
} |