Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
832b1f66
Commit
832b1f66
authored
5 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Fixed skyreach APT reg exp | refs
#29163
parent
ddf83b6c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_ubicast_packages_access.py
+7
-7
7 additions, 7 deletions
tests/test_ubicast_packages_access.py
with
7 additions
and
7 deletions
tests/test_ubicast_packages_access.py
+
7
−
7
View file @
832b1f66
...
...
@@ -37,19 +37,19 @@ with open(apt_source, 'r') as fo:
# # skyreach repo
# deb https://panel.ubicast.eu packaging/apt/s0000000000000000000000000000000/
expected
=
r
'
^deb (http[s]{0,1}://[A-Za-z0-9\.\-\_]+) packaging/apt/([A-Za-z0-9]+)/$
'
expected
=
r
'
^deb (http[s]{0,1}://[A-Za-z0-9\.\-\_]+) packaging/apt/([A-Za-z0-9
\.\-\_
]+)/$
'
url
=
None
ap
i_
ke
y
=
None
ap
t_to
ke
n
=
None
if
content
:
for
line
in
content
.
split
(
'
\n
'
):
m
=
re
.
match
(
expected
,
line
)
if
m
:
url
,
ap
i_
ke
y
=
m
.
groups
()
url
,
ap
t_to
ke
n
=
m
.
groups
()
if
not
url
or
not
ap
i_
ke
y
:
if
not
url
or
not
ap
t_to
ke
n
:
print
(
'
The file
"
%s
"
is not correct: skyreach url not found.
'
%
apt_source
)
sys
.
exit
(
1
)
print
(
'
SkyReach url is %s and API key is %s[...].
'
%
(
url
,
ap
i_
ke
y
[:
8
]))
print
(
'
SkyReach url is %s and API key is %s[...].
'
%
(
url
,
ap
t_to
ke
n
[:
8
]))
# Test SkyReach responses
req
=
requests
.
get
(
url
,
verify
=
False
)
...
...
@@ -60,9 +60,9 @@ if not req.ok:
else
:
print
(
'
Request to %s: OK.
'
%
url
)
apt_url
=
'
%s/packaging/apt/%s/Packages
'
%
(
url
,
ap
i_
ke
y
)
apt_url
=
'
%s/packaging/apt/%s/Packages
'
%
(
url
,
ap
t_to
ke
n
)
req
=
requests
.
get
(
apt_url
,
verify
=
False
)
apt_url
=
apt_url
.
replace
(
ap
i_
ke
y
,
ap
i_
ke
y
[:
8
]
+
'
[...]
'
)
apt_url
=
apt_url
.
replace
(
ap
t_to
ke
n
,
ap
t_to
ke
n
[:
8
]
+
'
[...]
'
)
if
not
req
.
ok
:
print
(
'
Request to %s failed (%s):
'
%
(
apt_url
,
req
.
status_code
))
print
(
req
.
text
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment