File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1515class SiteContext (ContextBase ):
1616 """An example of a context object, passed into and between callable models from the command line."""
1717
18- site : str = Field (default = "https://en.wikipedia.org/wiki/Main_Page " )
18+ site : str = Field (default = "https://news.ycombinator.com " )
1919
2020
2121class RestModel (CallableModel ):
Original file line number Diff line number Diff line change 99class TestEtl :
1010 def test_rest_model (self ):
1111 rest = RestModel ()
12- context = SiteContext (site = "https://en.wikipedia.org/wiki/Main_Page " )
12+ context = SiteContext (site = "https://news.ycombinator.com " )
1313 result = rest (context )
1414 assert result .value is not None
15- assert "Wikipedia " in result .value
15+ assert "Hacker News " in result .value
1616
1717 def test_links_model (self ):
1818 with NamedTemporaryFile (suffix = ".html" ) as file :
Original file line number Diff line number Diff line change @@ -52,14 +52,14 @@ from ccflow import ContextBase
5252from pydantic import Field
5353
5454class SiteContext (ContextBase ):
55- site: str = Field(default = " https://en.wikipedia.org/wiki/Main_Page " )
55+ site: str = Field(default = " https://news.ycombinator.com " )
5656```
5757
5858This class has a single attribute, ` site ` .
5959When we finish writing our ETL CLI, we will be able to pass in different contexts at runtime:
6060
6161``` bash
62- etl-cli +context=[] # use default wikipedia
62+ etl-cli +context=[] # use default hacker news
6363etl-cli +context=[" http://lobste.rs" ] # query lobste.rs instead
6464```
6565
You can’t perform that action at this time.
0 commit comments