return filecmp.cmpfiles(a, b, files, shallow=False)
-def fetch(v: Verification, channel_url: str) -> Channel:
- channel = Channel()
- channel.url = channel_url
+def fetch(v: Verification, channel: Channel) -> None:
v.status('Fetching channel')
- request = urllib.request.urlopen(
- 'https://channels.nixos.org/nixos-20.03', timeout=10)
+ request = urllib.request.urlopen(channel.url, timeout=10)
channel.channel_html = request.read()
channel.forwarded_url = request.geturl()
v.result(request.status == 200)
v.check('Got forwarded', channel.url != channel.forwarded_url)
- return channel
def parse_channel(v: Verification, channel: Channel) -> None:
def main() -> None:
v = Verification()
- channel = fetch(v, 'https://channels.nixos.org/nixos-20.03')
+ channel = Channel(url='https://channels.nixos.org/nixos-20.03')
+ fetch(v, channel)
parse_channel(v, channel)
fetch_resources(v, channel)
check_channel_contents(v, channel)