FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docsbuild-scripts/tests/test_build_docs_version.py at main · python/docsbuild-scripts · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
docsbuild-scripts
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
68
Star
84
Code
Issues
8
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
docsbuild-scripts
/
tests
/
test_build_docs_version.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
88 lines (65 loc) · 2.11 KB
Breadcrumbs
docsbuild-scripts
/
tests
/
test_build_docs_version.py
Copy path
File metadata and controls
88 lines (65 loc) · 2.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
from
__future__
import
annotations
import
pytest
from
build_docs
import
Version
def
test_equality
()
->
None
:
# Arrange
version1
=
Version
(
name
=
"3.13"
,
status
=
"stable"
,
branch_or_tag
=
"3.13"
)
version2
=
Version
(
name
=
"3.13"
,
status
=
"stable"
,
branch_or_tag
=
"3.13"
)
# Act / Assert
assert
version1
==
version2
@
pytest
.
mark
.
parametrize
(
(
"name"
,
"expected"
),
[
(
"3.13"
,
"-rrequirements.txt"
),
(
"3.10"
,
"standard-imghdr"
),
(
"3.7"
,
"sphinx==2.3.1"
),
(
"3.5"
,
"sphinx==1.8.4"
),
],
)
def
test_requirements
(
name
:
str
,
expected
:
str
)
->
None
:
# Arrange
version
=
Version
(
name
=
name
,
status
=
"stable"
,
branch_or_tag
=
""
)
# Act / Assert
assert
expected
in
version
.
requirements
def
test_requirements_error
()
->
None
:
# Arrange
version
=
Version
(
name
=
"2.8"
,
status
=
"ex-release"
,
branch_or_tag
=
""
)
# Act / Assert
with
pytest
.
raises
(
ValueError
,
match
=
"unreachable"
):
_
=
version
.
requirements
@
pytest
.
mark
.
parametrize
(
(
"status"
,
"expected"
),
[
(
"EOL"
,
"never"
),
(
"security-fixes"
,
"yearly"
),
(
"stable"
,
"daily"
),
],
)
def
test_changefreq
(
status
:
str
,
expected
:
str
)
->
None
:
# Arrange
version
=
Version
(
name
=
"3.13"
,
status
=
status
,
branch_or_tag
=
""
)
# Act / Assert
assert
version
.
changefreq
==
expected
def
test_url
()
->
None
:
# Arrange
version
=
Version
(
name
=
"3.13"
,
status
=
"stable"
,
branch_or_tag
=
""
)
# Act / Assert
assert
version
.
url
==
"https://docs.python.org/3.13/"
def
test_title
()
->
None
:
# Arrange
version
=
Version
(
name
=
"3.14"
,
status
=
"in development"
,
branch_or_tag
=
""
)
# Act / Assert
assert
version
.
title
==
"Python 3.14 (in development)"
@
pytest
.
mark
.
parametrize
(
(
"name"
,
"status"
,
"expected"
),
[
(
"3.15"
,
"in development"
,
"dev (3.15)"
),
(
"3.14"
,
"pre-release"
,
"pre (3.14)"
),
(
"3.13"
,
"stable"
,
"3.13"
),
],
)
def
test_picker_label
(
name
:
str
,
status
:
str
,
expected
:
str
)
->
None
:
# Arrange
version
=
Version
(
name
=
name
,
status
=
status
,
branch_or_tag
=
""
)
# Act / Assert
assert
version
.
picker_label
==
expected
Back
|
FazBrowse Home
|
New Git URL