-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
This package is just for overrides testing purposes. | ||
""" | ||
import socket | ||
from typing import Dict, Any, Callable | ||
|
||
from url_matcher import Patterns | ||
from url_matcher.util import get_domain | ||
from web_poet import handle_urls, ItemWebPage | ||
|
||
from tests.mockserver import get_ephemeral_port | ||
|
||
|
||
# Need to define it here since it's always changing | ||
DOMAIN = get_domain(socket.gethostbyname(socket.gethostname())) | ||
PORT = get_ephemeral_port() | ||
|
||
|
||
class POOverriden(ItemWebPage): | ||
def to_item(self): | ||
return {"msg": "PO that will be replace"} | ||
|
||
|
||
@handle_urls(f"{DOMAIN}:{PORT}", POOverriden) | ||
class POIntegration(ItemWebPage): | ||
def to_item(self): | ||
return {"msg": "PO replacement"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters