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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
ad38c89d
Commit
ad38c89d
authored
Jul 05, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated test with latest changes.
parent
f0ff55f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
bt5/erp5_web_shacache/TestTemplateItem/testShaCache.py
bt5/erp5_web_shacache/TestTemplateItem/testShaCache.py
+13
-9
bt5/erp5_web_shacache/bt/revision
bt5/erp5_web_shacache/bt/revision
+1
-1
No files found.
bt5/erp5_web_shacache/TestTemplateItem/testShaCache.py
View file @
ad38c89d
...
...
@@ -29,6 +29,7 @@
import
transaction
import
httplib
from
StringIO
import
StringIO
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
ShaCacheMixin
import
ShaCacheMixin
...
...
@@ -55,7 +56,7 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
transaction
.
commit
()
self
.
tic
()
def
p
os
tFile
(
self
,
key
=
None
):
def
p
u
tFile
(
self
,
key
=
None
):
"""
Post the file
"""
...
...
@@ -68,11 +69,13 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
data_file
.
seek
(
0
)
self
.
portal
.
changeSkin
(
'SHACACHE'
)
self
.
shacache
.
REQUEST
.
set
(
'method'
,
'POST'
)
self
.
shacache
.
REQUEST
.
set
(
'Content-Type'
,
'application/json'
)
self
.
shacache
.
REQUEST
.
_file
=
data_file
self
.
shacache
.
WebSection_getDocumentValue
(
key
)
path
=
self
.
shacache
.
getPath
()
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
key
),
request_method
=
'PUT'
,
stdin
=
data_file
,
basic
=
'ERP5TypeTestCase:'
)
self
.
stepTic
()
self
.
assertEqual
(
response
.
getStatus
(),
httplib
.
CREATED
)
finally
:
data_file
.
close
()
...
...
@@ -88,11 +91,11 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
self
.
shacache
.
REQUEST
.
set
(
'method'
,
'GET'
)
return
self
.
shacache
.
WebSection_getDocumentValue
(
key
)
def
test_p
os
t_file
(
self
):
def
test_p
u
t_file
(
self
):
"""
Check if the
posted file has all the properties defined
.
Check if the
PUT method is creating an object
.
"""
self
.
p
os
tFile
()
self
.
p
u
tFile
()
self
.
assertEquals
(
1
,
len
(
self
.
portal
.
document_module
))
document
=
self
.
portal
.
document_module
.
contentValues
()[
0
]
...
...
@@ -100,12 +103,13 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
self
.
assertEquals
(
self
.
key
,
document
.
getReference
())
self
.
assertEquals
(
self
.
data
,
document
.
getData
())
self
.
assertEquals
(
'application/octet-stream'
,
document
.
getContentType
())
self
.
assertEquals
(
'Published'
,
document
.
getValidationStateTitle
())
def
test_get_file
(
self
):
"""
Check if the file returned is the correct.
"""
self
.
test_p
os
t_file
()
self
.
test_p
u
t_file
()
self
.
assertEquals
(
1
,
len
(
self
.
portal
.
document_module
))
document
=
self
.
getFile
()
...
...
bt5/erp5_web_shacache/bt/revision
View file @
ad38c89d
38
\ No newline at end of file
39
\ 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