File: test_htmldiscover.py

package info (click to toggle)
python3-openid 3.0.2%2Bgit20140828-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,672 kB
  • ctags: 2,679
  • sloc: python: 17,137; xml: 234; sh: 15; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 632 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from openid.consumer.discover import OpenIDServiceEndpoint
from openid.test 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):
        super(BadLinksTestCase, self).__init__(data)
        self.data = data

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


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