Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cloudooo
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
Kirill Smelkov
cloudooo
Commits
25b527d4
Commit
25b527d4
authored
Feb 14, 2017
by
Boris Kocherov
Committed by
Romain Courteaud
Feb 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x2t: add support new version x2t and metadata
parent
b472db7e
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
233 additions
and
80 deletions
+233
-80
cloudooo/handler/x2t/handler.py
cloudooo/handler/x2t/handler.py
+202
-71
cloudooo/handler/x2t/tests/data/test_with_metadata.xlsy
cloudooo/handler/x2t/tests/data/test_with_metadata.xlsy
+0
-0
cloudooo/handler/x2t/tests/testX2tHandler.py
cloudooo/handler/x2t/tests/testX2tHandler.py
+31
-9
No files found.
cloudooo/handler/x2t/handler.py
View file @
25b527d4
This diff is collapsed.
Click to expand it.
cloudooo/handler/x2t/tests/data/test_with_metadata.xlsy
0 → 100644
View file @
25b527d4
File added
cloudooo/handler/x2t/tests/testX2tHandler.py
View file @
25b527d4
...
@@ -34,6 +34,9 @@ from cStringIO import StringIO
...
@@ -34,6 +34,9 @@ from cStringIO import StringIO
from
cloudooo.handler.x2t.handler
import
Handler
from
cloudooo.handler.x2t.handler
import
Handler
from
cloudooo.tests.handlerTestCase
import
HandlerTestCase
,
make_suite
from
cloudooo.tests.handlerTestCase
import
HandlerTestCase
,
make_suite
OPENOFFICE
=
True
class
TestHandler
(
HandlerTestCase
):
class
TestHandler
(
HandlerTestCase
):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
...
@@ -84,18 +87,37 @@ class TestHandler(HandlerTestCase):
...
@@ -84,18 +87,37 @@ class TestHandler(HandlerTestCase):
y_zip
.
open
(
"media/image1.png"
)
y_zip
.
open
(
"media/image1.png"
)
def
testgetMetadata
(
self
):
def
testgetMetadata
(
self
):
"""Test getMetadata from yformats
(not implemented)
"""
"""Test getMetadata from yformats"""
handler
=
Handler
(
self
.
tmp_url
,
""
,
"xlsy"
,
**
self
.
kw
)
handler
=
Handler
(
self
.
tmp_url
,
""
,
"xlsy"
,
**
self
.
kw
)
# Of course, expected behavior should be a dict of internal metadata
self
.
assertEquals
(
handler
.
getMetadata
(),
{
# but don't know how to handle it so far.
u'CreationDate'
:
u'00/00/0000 00:00:00'
,
self
.
assertEquals
(
handler
.
getMetadata
(),
{})
u'ImplementationName'
:
u'com.sun.star.comp.comphelper.OPropertyBag'
,
u'MIMEType'
:
u'text/plain'
,
u'ModificationDate'
:
u'00/00/0000 00:00:00'
,
u'PrintDate'
:
u'00/00/0000 00:00:00'
,
u'TemplateDate'
:
u'00/00/0000 00:00:00'
,
})
handler
=
Handler
(
self
.
tmp_url
,
open
(
"data/test_with_metadata.xlsy"
).
read
(),
"xlsy"
,
**
self
.
kw
)
self
.
assertEquals
(
handler
.
getMetadata
(),
{
u'CreationDate'
:
u'31/01/2018 21:09:10'
,
u'Keywords'
:
[
u'
\
u0442
\
u0435
\
u0441
\
u0442
'
,
u'
\
u0441
\
u0430
\
u0431
\
u0436
\
u0435
\
u043a
\
u0442
'
],
'MIMEType'
:
'xlsy'
,
u'ModificationDate'
:
u'31/01/2018 21:22:36'
,
u'PrintDate'
:
u'00/00/0000 00:00:00'
,
u'Subject'
:
u'
\
u0432
\
u044b
\
u043a
\
u043b
\
u044e
\
u0447
\
u0438
\
u0442
\
u0435
\
u043b
\
u0435
\
u0432
\
u0438
\
u0437
\
u043e
\
u0440
'
,
u'TemplateDate'
:
u'00/00/0000 00:00:00'
,
u'Title'
:
u'kesha'
})
def
testsetMetadata
(
self
):
def
testsetMetadata
(
self
):
"""Test setMetadata for yformats (not implemented)"""
"""Test setMetadata for yformats"""
handler
=
Handler
(
self
.
tmp_url
,
""
,
"xlsy"
,
**
self
.
kw
)
handler
=
Handler
(
self
.
tmp_url
,
open
(
"data/test_with_metadata.xlsy"
).
read
(),
"xlsy"
,
**
self
.
kw
)
# Of course, expected behavior should be an updated data with new
new_mime_data
=
handler
.
setMetadata
({
# internal metadata but don't know how to handle it so far.
"Title"
:
"test title"
,
self
.
assertEquals
(
handler
.
setMetadata
(),
""
)
"Subject"
:
"test subject"
,
"Keywords"
:
"test keywords"
,
})
handler
=
Handler
(
self
.
tmp_url
,
new_mime_data
,
"xlsy"
,
**
self
.
kw
)
self
.
assertEquals
(
handler
.
getMetadata
(),
{
u'Keywords'
:
u'test keywords'
,
'MIMEType'
:
'xlsy'
,
u'Title'
:
u'test title'
,
u'Subject'
:
u'test subject'
})
def
testGetAllowedConversionFormatList
(
self
):
def
testGetAllowedConversionFormatList
(
self
):
"""Test all combination of mimetype
"""Test all combination of mimetype
...
...
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