/
githubmirror
/
python3-libs
Обзор
Документация
Войти
/
githubmirror
/
python3-libs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/test_downloader.py
21 строка
803 B
Björn Lindqvist
lots of reorg, putting everything in packages
14 янв 2020, 22:59
14 янв 2020, 22:59
0b023dd
Код
Авторство
О чём код?
# Copyright (C) 2020 Björn Lindqvist <bjourne@gmail.com> from os import name as sys_name from os.path import getsize from tools.downloader import download_file, get_headers, local_path MATH_URL = 'https://math.stackexchange.com/questions/2582627/prove-sequent-using-natural-deduction' def test_local_path(): path = local_path(MATH_URL) assert path == 'prove-sequent-using-natural-deduction' if sys_name == 'posix': path = local_path(MATH_URL, '/tmp') assert path == '/tmp/prove-sequent-using-natural-deduction' path = local_path(MATH_URL, '/etc/passwd') assert path == '/etc/passwd' def test_get_headers(): fname = 'tests/test_downloader.py' headers = get_headers(fname) size = getsize(fname) assert headers['Range'] == 'bytes=%d-' % size