-
Notifications
You must be signed in to change notification settings - Fork 0
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
vlaszdunov
committed
Jun 5, 2024
1 parent
e4707b4
commit f1a40a5
Showing
3 changed files
with
13 additions
and
8 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
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,3 @@ | ||
<span class="release-version">3.11</span> | ||
<span>4</span> | ||
<span class="version">2</span> |
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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from src.version_parser import * | ||
|
||
BASE_URL = 'https://www.python.org/' | ||
|
||
|
||
test_html = bs(Path('tests/test_html.html').read_text(), 'lxml') | ||
|
||
|
||
def test_get_page_content(): | ||
page_content = get_page_content(BASE_URL) | ||
assert len(page_content.contents) != 0 | ||
|
||
|
||
def test_get_versions(): | ||
# Проверяем, что функция get_versions() использует результаты get_data() | ||
actual_versions = get_active_versions('downloads/') | ||
# Предположим, что это версии, которые мы ожидаем получить | ||
assert actual_versions.__class__==list | ||
actual_versions = get_active_versions(test_html) | ||
assert actual_versions == ['3.11'] |