File: test_htmldiscover.py

package info (click to toggle)
python-openid 2.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,472 kB
  • ctags: 3,328
  • sloc: python: 16,708; xml: 234; sh: 38; makefile: 30
file content (21 lines) | stat: -rw-r--r-- 627 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from openid.consumer.discover import OpenIDServiceEndpoint
import datadriven

class BadLinksTestCase(datadriven.DataDrivenTestCase):
    cases = [
        '',
        "http://not.in.a.link.tag/",
        '<link rel="openid.server" href="not.in.html.or.head" />',
        ]

    def __init__(self, data):
        datadriven.DataDrivenTestCase.__init__(self, data)
        self.data = data

    def runOneTest(self):
        actual = OpenIDServiceEndpoint.fromHTML('http://unused.url/', self.data)
        expected = []
        self.failUnlessEqual(expected, actual)

def pyUnitTests():
    return datadriven.loadTests(__name__)