Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
arch-historical-archive
Commits
77aa28d2
Commit
77aa28d2
authored
Apr 28, 2019
by
Florian Pritz
Browse files
Add test for archive.org case-insensitive identifier names
Signed-off-by:
Florian Pritz
<
bluewind@xinu.at
>
parent
9acd6efa
Changes
2
Hide whitespace changes
Inline
Side-by-side
test-data/include-list
View file @
77aa28d2
...
...
@@ -10,5 +10,10 @@
+ packages/f/
+ packages/f/fb-client/
+ packages/f/fb-client/*
+ packages/l/
+ packages/l/libreoffice-fresh-sr-latn/
+ packages/l/libreoffice-fresh-sr-latn/libreoffice-fresh-sr-latn-6.2.3-1-any.pkg.tar.xz*
+ packages/l/libreoffice-fresh-sr-Latn/
+ packages/l/libreoffice-fresh-sr-Latn/libreoffice-fresh-sr-Latn-5.3.0-1-any.pkg.tar.xz*
- *
test.py
View file @
77aa28d2
...
...
@@ -89,5 +89,43 @@ class TestUploader(unittest.TestCase):
self
.
assertTrue
(
app
.
db
.
exists
(
'fb-client-2.0.4-1-any.pkg.tar.xz'
))
self
.
assertTrue
(
app
.
db
.
exists
(
'fb-client-2.0.3-2-any.pkg.tar.xz'
))
def
test_upload_pkg_multiple_case
(
self
):
mock_uploader
=
MagicMock
()
app
=
upload_pkg_internetarchive
.
ArchiveUploader
(
mock_uploader
,
DB
.
DB
(
':memory:'
))
app
.
chunksize
=
2
response_ok
=
MagicMock
(
status_code
=
200
)
mock_uploader
.
upload
.
side_effect
=
[
[
response_ok
,
response_ok
],
[
response_ok
,
response_ok
]
]
self
.
assertFalse
(
app
.
db
.
exists
(
'libreoffice-fresh-sr-Latn-5.3.0-1-any.pkg.tar.xz'
))
self
.
assertFalse
(
app
.
db
.
exists
(
'libreoffice-fresh-sr-latn-6.2.3-1-any.pkg.tar.xz'
))
app
.
main
([
'./test-data/archive/packages/l/libreoffice-fresh-sr-Latn'
])
self
.
assertTrue
(
app
.
db
.
exists
(
'libreoffice-fresh-sr-Latn-5.3.0-1-any.pkg.tar.xz'
))
self
.
assertFalse
(
app
.
db
.
exists
(
'libreoffice-fresh-sr-latn-6.2.3-1-any.pkg.tar.xz'
))
app
.
main
([
'./test-data/archive/packages/l/libreoffice-fresh-sr-latn'
])
self
.
assertTrue
(
app
.
db
.
exists
(
'libreoffice-fresh-sr-Latn-5.3.0-1-any.pkg.tar.xz'
))
self
.
assertTrue
(
app
.
db
.
exists
(
'libreoffice-fresh-sr-latn-6.2.3-1-any.pkg.tar.xz'
))
mock_uploader
.
upload
.
assert_has_calls
([
call
(
'archlinux_pkg_libreoffice-fresh-sr-Latn'
,
files
=
[
'./test-data/archive/packages/l/libreoffice-fresh-sr-Latn/libreoffice-fresh-sr-Latn-5.3.0-1-any.pkg.tar.xz'
,
'./test-data/archive/packages/l/libreoffice-fresh-sr-Latn/libreoffice-fresh-sr-Latn-5.3.0-1-any.pkg.tar.xz.sig'
,],
metadata
=
mock
.
ANY
),
# should be uploaded with the previous identifier (i.e. Latn instead of latn)
call
(
'archlinux_pkg_libreoffice-fresh-sr-Latn'
,
files
=
[
'./test-data/archive/packages/l/libreoffice-fresh-sr-latn/libreoffice-fresh-sr-latn-6.2.3-1-any.pkg.tar.xz'
,
'./test-data/archive/packages/l/libreoffice-fresh-sr-latn/libreoffice-fresh-sr-latn-6.2.3-1-any.pkg.tar.xz.sig'
,],
metadata
=
mock
.
ANY
),
])
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment