Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
test_EmbedObject.TestEmbedObject Class Reference
Collaboration diagram for test_EmbedObject.TestEmbedObject:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setup_class
def teardown_class
def testEmbedObjectMimetype
def testEmbedObjectDefaultValues
def testEmbedObjectPercentHeight
def testEmbedObjectFromUrl

Public Attributes

 page

Static Public Attributes

string pagename = u'AutoCreatedMoinMoinTemporaryTestPageForEmbedObject'

Detailed Description

testing macro Action calling action raw 

Definition at line 16 of file test_EmbedObject.py.


Member Function Documentation

Definition at line 20 of file test_EmbedObject.py.

00020 
00021     def setup_class(self):
00022         request = self.request
00023         pagename = self.pagename
00024         become_trusted(request)
00025         self.page = create_page(request, pagename, u"Foo")
00026         AttachFile.getAttachDir(request, pagename)
00027         test_files = [
00028             ('test.ogg', 'vorbis'),
00029             ('test.svg', 'SVG'),
00030             ('test.mpg', 'MPG'),
00031             ('test.pdf', 'PDF'),
00032             ('test.mp3', 'MP3'),
00033         ]
00034         for filename, filecontent in test_files:
00035             AttachFile.add_attachment(request, pagename, filename, filecontent, overwrite=0)

Here is the call graph for this function:

Definition at line 36 of file test_EmbedObject.py.

00036 
00037     def teardown_class(self):
00038         nuke_page(self.request, self.pagename)

Here is the call graph for this function:

tests default values of macro EmbedObject 

Definition at line 52 of file test_EmbedObject.py.

00052 
00053     def testEmbedObjectDefaultValues(self):
00054         """ tests default values of macro EmbedObject """
00055         m = make_macro(self.request, self.page)
00056         filename = 'test.mpg'
00057         result = m.execute('EmbedObject', u'%s' % filename)
00058         assert '<object data="/AutoCreatedMoinMoinTemporaryTestPageForEmbedObject?action=AttachFile&amp;do=get&amp;target=test.mpg"' in result
00059         assert 'align="middle"' in result
00060         assert 'value="transparent"' in result

Here is the call graph for this function:

tests using a URL for macro EmbedObject 

Definition at line 71 of file test_EmbedObject.py.

00071 
00072     def testEmbedObjectFromUrl(self):
00073         """ tests using a URL for macro EmbedObject """
00074         m = make_macro(self.request, self.page)
00075         target = 'http://localhost/%s?action=AttachFile&do=view&target=test.mpg' % self.pagename
00076         result = m.execute('EmbedObject', u'target=%s, url_mimetype=video/mpeg' % target)
00077         assert '<object data="http://localhost/AutoCreatedMoinMoinTemporaryTestPageForEmbedObject?action=AttachFile&amp;do=view&amp;target=test.mpg" type="video/mpeg"' in result

Here is the call graph for this function:

tests defined mimetyes 

Definition at line 39 of file test_EmbedObject.py.

00039 
00040     def testEmbedObjectMimetype(self):
00041         """ tests defined mimetyes """
00042         tests = [
00043             (u'test.pdf', 'application/pdf'),
00044             (u'test.svg', 'image/svg+xml'),
00045             (u'test.mpg', 'video/mpeg'),
00046             (u'test.mp3', 'audio/mpeg'),
00047         ]
00048         for filename, mimetype in tests:
00049             m = make_macro(self.request, self.page)
00050             result = m.execute('EmbedObject', filename)
00051             assert mimetype in result

Here is the call graph for this function:

tests a unit value for macro EmbedObject 

Definition at line 61 of file test_EmbedObject.py.

00061 
00062     def testEmbedObjectPercentHeight(self):
00063         """ tests a unit value for macro EmbedObject """
00064         m = make_macro(self.request, self.page)
00065         filename = 'test.mpg'
00066         height = '50 %' # also tests that space is allowed in there
00067         result = m.execute('EmbedObject', u'target=%s, height=%s' % (filename, height))
00068         assert '<object data="/AutoCreatedMoinMoinTemporaryTestPageForEmbedObject?action=AttachFile&amp;do=get&amp;target=test.mpg"' in result
00069         assert 'height="50%"' in result
00070         assert 'align="middle"' in result

Here is the call graph for this function:


Member Data Documentation

Definition at line 24 of file test_EmbedObject.py.

string test_EmbedObject.TestEmbedObject.pagename = u'AutoCreatedMoinMoinTemporaryTestPageForEmbedObject' [static]

Definition at line 18 of file test_EmbedObject.py.


The documentation for this class was generated from the following file: