Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mukul
erp5
Commits
9499e514
Commit
9499e514
authored
Sep 01, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test.
Follow new way of POSTing instead of putting.
parent
46e1fa2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
bt5/networkcache_erp5/TestTemplateItem/testShaCacheExternal.py
...etworkcache_erp5/TestTemplateItem/testShaCacheExternal.py
+8
-8
bt5/networkcache_erp5/bt/revision
bt5/networkcache_erp5/bt/revision
+1
-1
No files found.
bt5/networkcache_erp5/TestTemplateItem/testShaCacheExternal.py
View file @
9499e514
...
...
@@ -29,7 +29,6 @@
import
base64
import
os
import
transaction
import
httplib
from
DateTime
import
DateTime
...
...
@@ -77,7 +76,7 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
# HTTP Connection properties
self
.
host
=
self
.
portal
.
REQUEST
.
get
(
'SERVER_NAME'
)
self
.
port
=
self
.
portal
.
REQUEST
.
get
(
'SERVER_PORT'
)
self
.
path
=
os
.
path
.
join
(
self
.
shacache
.
getPath
(),
self
.
key
)
self
.
path
=
self
.
shacache
.
getPath
(
)
def
test_external_post
(
self
):
"""
...
...
@@ -86,15 +85,15 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
now
=
DateTime
()
connection
=
httplib
.
HTTPConnection
(
'%s:%s'
%
(
self
.
host
,
self
.
port
))
try
:
connection
.
request
(
'P
U
T'
,
self
.
path
,
self
.
data
,
self
.
header_dict
)
connection
.
request
(
'P
OS
T'
,
self
.
path
,
self
.
data
,
self
.
header_dict
)
result
=
connection
.
getresponse
()
transaction
.
commit
()
self
.
tic
()
data
=
result
.
read
()
finally
:
connection
.
close
()
self
.
assertEquals
(
''
,
data
)
self
.
assertEquals
(
201
,
result
.
status
)
self
.
assertEquals
(
self
.
key
,
data
)
self
.
assertEquals
(
httplib
.
CREATED
,
result
.
status
)
# Check Document
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'File'
,
...
...
@@ -117,13 +116,14 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
connection
=
httplib
.
HTTPConnection
(
'%s:%s'
%
(
self
.
host
,
self
.
port
))
try
:
connection
.
request
(
'GET'
,
self
.
path
,
headers
=
header_dict
)
connection
.
request
(
'GET'
,
'/'
.
join
([
self
.
path
,
self
.
key
]),
headers
=
header_dict
)
result
=
connection
.
getresponse
()
data
=
result
.
read
()
finally
:
connection
.
close
()
self
.
assertEquals
(
self
.
data
,
data
)
self
.
assertEquals
(
200
,
result
.
status
)
self
.
assertEquals
(
httplib
.
OK
,
result
.
status
)
self
.
assertEquals
(
self
.
expected_content_type
,
result
.
getheader
(
"content-type"
))
...
...
@@ -141,7 +141,7 @@ class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
connection
=
httplib
.
HTTPConnection
(
'%s:%s'
%
(
self
.
host
,
self
.
port
))
header_dict
=
{
'Content-Type'
:
self
.
content_type
}
try
:
connection
.
request
(
'P
U
T'
,
self
.
path
,
self
.
data
,
header_dict
)
connection
.
request
(
'P
OS
T'
,
self
.
path
,
self
.
data
,
header_dict
)
result
=
connection
.
getresponse
()
transaction
.
commit
()
self
.
tic
()
...
...
bt5/networkcache_erp5/bt/revision
View file @
9499e514
22
\ No newline at end of file
23
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment