Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
user-discovery-bot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
archives
user-discovery-bot
Commits
00154b49
Commit
00154b49
authored
Jul 19, 2018
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
Added test coverage to search
parent
12b28244
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
udb/search_test.go
+31
-0
31 additions, 0 deletions
udb/search_test.go
with
31 additions
and
0 deletions
udb/search_test.go
+
31
−
0
View file @
00154b49
...
...
@@ -32,5 +32,36 @@ func TestSearchHappyPath(t *testing.T) {
}
ReceiveMessage
(
msg
)
}
}
// Test invalid search type
func
TestSearch_Invalid_Type
(
t
*
testing
.
T
)
{
fingerprint
:=
"8oKh7TYG4KxQcBAymoXPBHSD/uga9pX3Mn/jKhvcD8M="
msgs
:=
[]
string
{
"SEARCH INVALID test"
,
"GETKEY "
+
fingerprint
,
}
for
i
:=
range
msgs
{
msg
,
err
:=
NewMessage
(
msgs
[
i
])
if
err
!=
nil
{
t
.
Errorf
(
"Error generating message: %v"
,
err
)
}
ReceiveMessage
(
msg
)
}
}
// Test invalid user
func
TestSearch_Invalid_User
(
t
*
testing
.
T
)
{
msgs
:=
[]
string
{
"SEARCH EMAIL cat@privategrity.com"
,
}
for
i
:=
range
msgs
{
msg
,
err
:=
NewMessage
(
msgs
[
i
])
if
err
!=
nil
{
t
.
Errorf
(
"Error generating message: %v"
,
err
)
}
ReceiveMessage
(
msg
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment