Back to index

plone3  3.1.7
Public Member Functions
kupu.plone.tests.test_urls.test_urls Class Reference

List of all members.

Public Member Functions

def test1
def testRelativeLinks1
def testRelativeLinks2
def testRelativeLinks3
def testRelativeLinks4
def testRelativeLinks5
def testRelativeLinks6
def testRelativeQuery

Detailed Description

Definition at line 24 of file test_urls.py.


Member Function Documentation

Definition at line 25 of file test_urls.py.

00025 
00026     def test1(self):
00027         data = 'http://host/site/a'
00028         base = 'http://host/site/'
00029         expected = 'a', ''
00030         self.assertEquals(expected, makeUrlRelative(data, base))

Definition at line 31 of file test_urls.py.

00031 
00032     def testRelativeLinks1(self):
00033         data =  'http://localhost/cms/folder/jim#_ftnref1'
00034         expected = "jim", "#_ftnref1"
00035         base = 'http://localhost/cms/folder/fred'
00036 
00037         self.assertEquals(expected, makeUrlRelative(data, base))

Definition at line 38 of file test_urls.py.

00038 
00039     def testRelativeLinks2(self):
00040         data =  "http://localhost/cms/folder/otherdoc#key"
00041         expected = "otherdoc", "#key"
00042         base = 'http://localhost/cms/folder/'
00043 
00044         self.assertEquals(expected, makeUrlRelative(data, base))

Definition at line 45 of file test_urls.py.

00045 
00046     def testRelativeLinks3(self):
00047         data =  "http://localhost/cms/otherfolder/otherdoc"
00048         expected = "../otherfolder/otherdoc", ""
00049         base = 'http://localhost/cms/folder/'
00050 
00051         self.assertEquals(expected, makeUrlRelative(data, base))

Definition at line 52 of file test_urls.py.

00052 
00053     def testRelativeLinks4(self):
00054         data =  "http://localhost:9080/plone/Members/admin/art1"
00055         expected = "", ""
00056         base = 'http://localhost:9080/plone/Members/admin/art1'
00057 
00058         self.assertEquals(expected, makeUrlRelative(data, base))

Definition at line 59 of file test_urls.py.

00059 
00060     def testRelativeLinks5(self):
00061         data =  'http://localhost:9080/plone/Members/admin/art1/subitem'
00062         expected = "art1/subitem", ""
00063         base = 'http://localhost:9080/plone/Members/admin/art1'
00064 
00065         actual = makeUrlRelative(data, base)
00066         self.assertEquals(actual, expected)

Definition at line 67 of file test_urls.py.

00067 
00068     def testRelativeLinks6(self):
00069         data =  "http://localhost:9080/plone/Members/admin"
00070         expected = ".", ""
00071         base = 'http://localhost:9080/plone/Members/admin/art1'
00072 
00073         actual = makeUrlRelative(data, base)
00074         self.assertEquals(actual, expected)

Definition at line 75 of file test_urls.py.

00075 
00076     def testRelativeQuery(self):
00077         data =  "http://localhost:9080/plone/Members/admin/jim?x=5"
00078         expected = "jim", "?x=5"
00079         base = 'http://localhost:9080/plone/Members/admin/art1'
00080 
00081         actual = makeUrlRelative(data, base)
00082         self.assertEquals(actual, expected)


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