Пример #1
0
    def testCommunityUrlParams (self):
        url = 'http://community.livejournal.com/ljournal-ist/14774.html?format=light&style=mine'

        ljurl = LJUrl.parse (url)

        self.assertEqual (ljurl.username, 'ljournal-ist')
        self.assertEqual (ljurl.postid, 14774)
Пример #2
0
    def testCommunityUrlParamsEmpty (self):
        url = 'http://community.livejournal.com/ljournal-ist/14774.html?'

        ljurl = LJUrl.parse (url)

        self.assertEqual (ljurl.username, 'ljournal-ist')
        self.assertEqual (ljurl.postid, 14774)
Пример #3
0
    def testUserUrlParams (self):
        url = 'http://users.livejournal.com/___lin___/254416.html?format=light&style=mine'
        ljurl = LJUrl.parse (url)

        self.assertEqual (ljurl.username, '___lin___')
        self.assertEqual (ljurl.postid, 254416)
        self.assertEqual (ljurl.pureUrl, 'http://users.livejournal.com/___lin___/254416.html')
Пример #4
0
    def testCommunityUrl (self):
        url = 'http://community.livejournal.com/ljournalist/123456.html'

        ljurl = LJUrl.parse (url)

        self.assertEqual (ljurl.username, 'ljournalist')
        self.assertEqual (ljurl.postid, 123456)
Пример #5
0
    def testSimpleUrlParamsEmpty (self):
        url = 'http://user-name.livejournal.com/123456.html?'

        ljurl = LJUrl.parse (url)

        self.assertEqual (ljurl.username, 'user-name')
        self.assertEqual (ljurl.postid, 123456)
Пример #6
0
    def testSimpleUrlParams (self):
        url = 'http://user-name.livejournal.com/123456.html?format=light&style=mine'

        ljurl = LJUrl.parse (url)

        self.assertEqual (ljurl.username, 'user-name')
        self.assertEqual (ljurl.postid, 123456)
Пример #7
0
    def testPureUrl2 (self):
        url = 'http://community.livejournal.com/ljournal-ist/14774.html?format=light&style=mine'
        ljurl = LJUrl.parse (url)

        pureUrl = ljurl.pureUrl

        self.assertEqual (pureUrl, 'http://ljournal-ist.livejournal.com/14774.html')
Пример #8
0
    def testPureUrl1 (self):
        url = 'http://user-name.livejournal.com/123456.html?format=light&style=mine'
        ljurl = LJUrl.parse (url)

        pureUrl = ljurl.pureUrl

        self.assertEqual (pureUrl, 'http://user-name.livejournal.com/123456.html')
Пример #9
0
    def testUserUrl (self):
        url = 'http://users.livejournal.com/___lin___/254416.html'
        ljurl = LJUrl.parse (url)

        self.assertEqual (ljurl.username, '___lin___')
        self.assertEqual (ljurl.postid, 254416)