本文整理汇总了Python中mincss.processor.Processor.make_absolute_url方法的典型用法代码示例。如果您正苦于以下问题:Python Processor.make_absolute_url方法的具体用法?Python Processor.make_absolute_url怎么用?Python Processor.make_absolute_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mincss.processor.Processor
的用法示例。
在下文中一共展示了Processor.make_absolute_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_make_absolute_url
# 需要导入模块: from mincss.processor import Processor [as 别名]
# 或者: from mincss.processor.Processor import make_absolute_url [as 别名]
def test_make_absolute_url(self):
p = Processor()
eq_(p.make_absolute_url("http://www.com/", "./style.css"), "http://www.com/style.css")
eq_(p.make_absolute_url("http://www.com", "./style.css"), "http://www.com/style.css")
eq_(p.make_absolute_url("http://www.com", "//cdn.com/style.css"), "http://cdn.com/style.css")
eq_(p.make_absolute_url("http://www.com/", "//cdn.com/style.css"), "http://cdn.com/style.css")
eq_(p.make_absolute_url("http://www.com/", "/style.css"), "http://www.com/style.css")
eq_(p.make_absolute_url("http://www.com/elsewhere", "/style.css"), "http://www.com/style.css")
eq_(p.make_absolute_url("http://www.com/elsewhere/", "/style.css"), "http://www.com/style.css")
eq_(p.make_absolute_url("http://www.com/elsewhere/", "./style.css"), "http://www.com/elsewhere/style.css")
eq_(p.make_absolute_url("http://www.com/elsewhere", "./style.css"), "http://www.com/style.css")
示例2: test_make_absolute_url
# 需要导入模块: from mincss.processor import Processor [as 别名]
# 或者: from mincss.processor.Processor import make_absolute_url [as 别名]
def test_make_absolute_url(self):
p = Processor()
eq_(
p.make_absolute_url('http://www.com/', './style.css'),
'http://www.com/style.css'
)
eq_(
p.make_absolute_url('http://www.com', './style.css'),
'http://www.com/style.css'
)
eq_(
p.make_absolute_url('http://www.com', '//cdn.com/style.css'),
'http://cdn.com/style.css'
)
eq_(
p.make_absolute_url('http://www.com/', '//cdn.com/style.css'),
'http://cdn.com/style.css'
)
eq_(
p.make_absolute_url('http://www.com/', '/style.css'),
'http://www.com/style.css'
)
eq_(
p.make_absolute_url('http://www.com/elsewhere', '/style.css'),
'http://www.com/style.css'
)
eq_(
p.make_absolute_url('http://www.com/elsewhere/', '/style.css'),
'http://www.com/style.css'
)
eq_(
p.make_absolute_url('http://www.com/elsewhere/', './style.css'),
'http://www.com/elsewhere/style.css'
)
eq_(
p.make_absolute_url('http://www.com/elsewhere', './style.css'),
'http://www.com/style.css'
)