Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
e309efef
Verified
Commit
e309efef
authored
Nov 06, 2021
by
Baptiste Beauplat
Browse files
Add unit test for Changes to cover get_source re-call
parent
cc9964f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/tools/debian/test_changes.py
0 → 100644
View file @
e309efef
# test_changes.py - unit testing for Changes
#
# This file is part of debexpo
# https://salsa.debian.org/mentors.debian.net-team/debexpo
#
# Copyright © 2019-2021 Baptiste Beauplat <lyknode@debian.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from
tests
import
TestController
from
os.path
import
join
,
dirname
from
debexpo.tools.debian.changes
import
Changes
CHANGES_FILE_OK
=
join
(
dirname
(
__file__
),
'..'
,
'..'
,
'..'
,
'functional'
,
'importer'
,
'data'
,
'ok'
,
'hello_1.0-1_amd64.changes'
)
class
TestChanges
(
TestController
):
def
test_dsc_from_changes
(
self
):
changes
=
Changes
(
CHANGES_FILE_OK
)
changes
.
validate
()
changes
.
parse_dsc
()
source
=
changes
.
get_source
()
try
:
source
.
extract
()
source
.
parse_control_files
()
finally
:
source
.
remove
()
self
.
assertEquals
(
source
,
changes
.
get_source
())
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment