Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
soledad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
leap
soledad
Commits
5c810908
Verified
Commit
5c810908
authored
7 years ago
by
Victor
Browse files
Options
Downloads
Patches
Plain Diff
[test] init StreamingResource on test_blobs_server
-- Related:
#8809
parent
0772476f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!166
Streaming blobs (Related: #8809 #8810 #8773 )
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/server/test_blobs_server.py
+10
-1
10 additions, 1 deletion
tests/server/test_blobs_server.py
with
10 additions
and
1 deletion
tests/server/test_blobs_server.py
+
10
−
1
View file @
5c810908
...
...
@@ -19,16 +19,19 @@ Integration tests for blobs server
"""
import
os
import
pytest
from
urlparse
import
urljoin
from
uuid
import
uuid4
from
io
import
BytesIO
from
twisted.trial
import
unittest
from
twisted.web.server
import
Site
from
twisted.web.resource
import
Resource
from
twisted.internet
import
reactor
from
twisted.internet
import
defer
from
treq._utils
import
set_global_pool
from
leap.soledad.common.blobs
import
Flags
from
leap.soledad.server
import
_blobs
as
server_blobs
from
leap.soledad.server._streaming_resource
import
StreamingResource
from
leap.soledad.client._db.blobs
import
BlobManager
from
leap.soledad.client._db.blobs
import
BlobAlreadyExistsError
from
leap.soledad.client._db.blobs
import
InvalidFlagsError
...
...
@@ -50,11 +53,17 @@ class BlobServerTestCase(unittest.TestCase):
def
setUp
(
self
):
client_blobs
.
sync
.
MAX_WAIT
=
0.1
root
=
server_blobs
.
BlobsResource
(
"
filesystem
"
,
self
.
tempdir
)
blobs_resource
=
server_blobs
.
BlobsResource
(
"
filesystem
"
,
self
.
tempdir
)
stream_resource
=
StreamingResource
(
"
filesystem
"
,
self
.
tempdir
)
root
=
Resource
()
root
.
putChild
(
'
blobs
'
,
blobs_resource
)
root
.
putChild
(
'
stream
'
,
stream_resource
)
self
.
site
=
Site
(
root
)
self
.
port
=
reactor
.
listenTCP
(
0
,
self
.
site
,
interface
=
'
127.0.0.1
'
)
self
.
host
=
self
.
port
.
getHost
()
self
.
uri
=
'
http://%s:%s/
'
%
(
self
.
host
.
host
,
self
.
host
.
port
)
self
.
stream_uri
=
urljoin
(
self
.
uri
,
'
stream/
'
)
self
.
uri
=
urljoin
(
self
.
uri
,
'
blobs/
'
)
self
.
secret
=
'
A
'
*
96
set_global_pool
(
None
)
...
...
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