def testReplaceDateRemote(self): """ test the replacement of the date glob for url use""" res = static.fnGlob('/test.shtml$lang$date', langsMock) self.assertEqual(len(res)/len(langsMock), 366) # 2008 is a leap year assert '/test.shtml?lang=de&year=2008&month=2&day=29' in res
def testNoReplace(self): """ w/o any special $params, it should return simply its input """ assert '/home/foo' == static.fnGlob('/home/foo', langsMock)[0]
def testReplaceLangRemote(self): """ tests the replacement of languages for url use""" res = static.fnGlob('/test.shtml$lang', langsMock) assert len(res) == len(langsMock), "not enough expanded: %i" % len(res) for lang in langsMock: assert '/test.shtml?lang='+lang in res, "lang missing: %s" % lang