good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
websocket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
github
nhooyr
websocket
Commits
3c34db4c
"git@gfx.cafe:open/bor.git" did not exist on "d6625ac34dad741f5659ca1dad3b0179603d37f0"
Unverified
Commit
3c34db4c
authored
Sep 1, 2019
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
Small fixes
parent
23a3ede4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
websocket_autobahn_python_test.go
+3
-0
3 additions, 0 deletions
websocket_autobahn_python_test.go
websocket_test.go
+5
-10
5 additions, 10 deletions
websocket_test.go
with
8 additions
and
10 deletions
websocket_autobahn_python_test.go
+
3
−
0
View file @
3c34db4c
// This file contains the old autobahn test suite tests that use the
// python binary. The approach is very clunky and slow so new tests
// have been written in pure Go in websocket_test.go.
// +build autobahn-python
package
websocket_test
...
...
This diff is collapsed.
Click to expand it.
websocket_test.go
+
5
−
10
View file @
3c34db4c
...
...
@@ -47,10 +47,7 @@ func TestHandshake(t *testing.T) {
c
.
Close
(
websocket
.
StatusInternalError
,
""
)
return
xerrors
.
New
(
"expected error regarding bad origin"
)
}
if
!
strings
.
Contains
(
err
.
Error
(),
"not authorized"
)
{
return
xerrors
.
Errorf
(
"expected error regarding bad origin: %+v"
,
err
)
}
return
nil
return
assertErrorContains
(
err
,
"not authorized"
)
},
client
:
func
(
ctx
context
.
Context
,
u
string
)
error
{
h
:=
http
.
Header
{}
...
...
@@ -62,10 +59,7 @@ func TestHandshake(t *testing.T) {
c
.
Close
(
websocket
.
StatusInternalError
,
""
)
return
xerrors
.
New
(
"expected handshake failure"
)
}
if
!
strings
.
Contains
(
err
.
Error
(),
"403"
)
{
return
xerrors
.
Errorf
(
"expected handshake failure: %+v"
,
err
)
}
return
nil
return
assertErrorContains
(
err
,
"403"
)
},
},
{
...
...
@@ -123,8 +117,9 @@ func TestHandshake(t *testing.T) {
if
err
!=
nil
{
return
xerrors
.
Errorf
(
"request is missing mycookie: %w"
,
err
)
}
if
cookie
.
Value
!=
"myvalue"
{
return
xerrors
.
Errorf
(
"expected %q but got %q"
,
"myvalue"
,
cookie
.
Value
)
err
=
assertEqualf
(
"myvalue"
,
cookie
.
Value
,
"unexpected cookie value"
)
if
err
!=
nil
{
return
err
}
c
,
err
:=
websocket
.
Accept
(
w
,
r
,
nil
)
if
err
!=
nil
{
...
...
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