2 sys
.path
.insert(0, '../src/lib')
8 def testFormatDateBadEncoding(self
):
10 encoding
= "en_US.ISO8859-1"
12 time
= (2004, 8, 5, 20, 29, 59, 3, 218, 0)
14 utils
.format_date(time
, format
, encoding
)
16 self
.fail("format_date: %s" % str(ex
))
18 def testURLlocation(self
):
19 url
= "http://www.amazon.com/gp/aws/sdk/103-9053546-3314261"
20 self
.assertEqual("http://www.amazon.com", utils
.get_url_location(url
))
22 def testReadText(self
):
23 text
= "Blah >foo< <p>bar</p>"
24 t
= utils
.read_text(text
, 60)
25 self
.assertEqual(t
, "Blah >foo< bar")
27 def testCompleteUrl(self
):
28 tlist
= [("images/foo.jpg","http://blah.com","http://blah.com/images/foo.jpg"),
29 ("/images/foo.jpg","http://b.com","http://b.com/images/foo.jpg")]
31 self
.assertEqual(r
,utils
.complete_url(u
,b
))