File: __init__.py

package info (click to toggle)
python-web-poet 0.23.2-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 908 kB
  • sloc: python: 6,112; makefile: 19
file content (28 lines) | stat: -rw-r--r-- 644 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""This package is being used by tests/po_lib to validate some behaviors on
external depedencies.
"""

from __future__ import annotations

from typing import Any

from url_matcher import Patterns

from web_poet import ItemPage, handle_urls


class POBase(ItemPage):
    expected_instead_of: type[ItemPage]
    expected_patterns: Patterns
    expected_meta: dict[str, Any]


class POLibSubOverriden(ItemPage): ...


@handle_urls("sub.example", instead_of=POLibSubOverriden)
class POLibSub(POBase):
    expected_instead_of = POLibSubOverriden
    expected_patterns = Patterns(["sub.example"])
    expected_to_return = None
    expected_meta = {}