36 Commits

Author SHA1 Message Date
Dan Streetman
b4ca04efaa test: fix archive tests
Assumptions were made about the implementation by mocking
that are no longer true, and the tests generally need to be
fixed to be more robust about testing
2021-07-14 17:41:10 -04:00
Dan Streetman
12c2e6bf42 test: remove unneeded stuff in test/__init__.py
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
48c7130008 test: remove dep on mock, use unittest.mock instead
Signed-off-by: Dan Streetman <ddstreet@canonical.com>
2021-02-02 06:25:12 -05:00
Dan Streetman
fe4d2f08a5 test: remove test_dsc_missing test
This test class performs 'local source package' tests, but a missing
local dsc file won't perform any local test, it will query the LP server.
The test attempted to narrowly mock out specific network access to
emulate a 'missing' package by trying to return 404 when the url from
SourcePackage._lp_url() is opened, but now that _lp_url() is removed,
a missing local dsc file will result in full querying of the LP api,
which is not as easily mocked.
2020-03-06 13:01:37 +01:00
Dan Streetman
1a30454d1e test: remove test_archive obsolete tests
some tests mocked into the implementation of archive.py, which has now
changed dramatically, and the tests are no longer valid.
2019-11-25 10:10:06 -05:00
Dan Streetman
90e8fe81e1 replace ubuntutools.logger with standard python logging 2019-11-25 10:10:06 -05:00
Dan Streetman
3a413760f3 ubuntutools: add pull-* --no-verify-signature option, don't fail if no pub key
Change dsc verification to fail only if the public key was available, but
signature verification failed.  If no public key is available for the dsc,
print warning only. (LP: #1700846)

Also add pull-* parameter --no-verify-signature to manually prevent failure
when signature verification fails.
2019-11-25 10:10:06 -05:00
Dan Streetman
b96885f05e ubuntutools/archive: convert external rmadison call to native implementation
instead of a function that calls the system program rmadison, use
a fully-functional class to interface with the madison api, as well
as the debian snapshot api
2019-11-25 09:57:54 -05:00
Dan Streetman
b0c22e1d57 pull-pkg: update archive.py SourcePackage
verify it can parse/load DSC when created
throw PackageNotFoundException from lp_spph if can't find package
update test case expected order of url processing
2019-11-25 09:57:54 -05:00
Stefano Rivera
7b2f1a713b Remove more Python 2 fallback imports 2019-09-05 09:49:41 -03:00
Stefano Rivera
301569e809 Pull out Python 2 support hacks 2019-09-04 19:24:44 -03:00
Mattia Rizzolo
3fb7516d72
Default to checking signatures while pulling a .dsc.
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
2019-08-05 13:50:33 +02:00
Benjamin Drung
cc7170eccb Fix all flake8 issues 2017-05-01 00:20:03 +02:00
Dimitri John Ledkov
8ae64c16e2 Disable test_dsc_badsig, when no networking is available. 2014-12-18 23:35:00 +00:00
Dimitri John Ledkov
866adfd768 Actually, now that more things expect streaming bytes over the wire
the mirror tests don't stall anymore. Also use a codec.reader to slurp
up unicode bytes for json.load.
2014-12-18 23:18:00 +00:00
Dimitri John Ledkov
5da114b070 More consistent binary handling throughout.
Don't mock open(..., "b") with str / StringIO.
Silence source package pull, buffered/mocked output does not flush.
Disable mirror tests on python3, stall/hang.
2014-12-18 23:03:23 +00:00
Dimitri John Ledkov
d86cacddf9 finish no-regress pre-port. 2014-12-18 21:18:01 +00:00
Dimitri John Ledkov
d4f6ef320e remains of mox 2014-12-16 01:44:13 +00:00
Dimitri John Ledkov
88e3d1d6ba Port http_mock to mock. 2014-12-15 04:24:41 +00:00
Dimitri John Ledkov
72487d0477 Stubout 2014-12-15 03:42:49 +00:00
Dimitri John Ledkov
7d70b6b3a3 Dropping mox 2014-12-15 03:25:41 +00:00
Stefano Rivera
e21f15865c * Thanks for the NMU, Paul.
* Non-maintainer upload.
* Change debian.tar.gz to debian.tar.xz (Closes: #738413)
2014-02-25 22:46:10 +02:00
Benjamin Drung
c2aa97dba2 Move devscripts.logger to ubuntutools.logger. 2013-03-19 00:18:02 +01:00
Stefano Rivera
52fc42ca8f Make ubuntutools.archive a little more testable, by making its urlopener an
instance property.

Replace these with mocks, as needed, rather than mocking out urllib2.urlopen.

Makes the test suite pass again.
2012-03-26 10:00:46 +02:00
Stefano Rivera
70a035f13d Use httplib2 everywhere that we do https. The python stdlib doesn't do
certificate verification.
2011-11-22 15:57:02 +02:00
Stefano Rivera
6e719c751d Remove unecessary MultipleTimes() 2011-09-04 22:48:45 +02:00
Stefano Rivera
17b287e7bf ubuntutools.archive: Don't write .dsc files until we pull the entire
source package, just hold it in memory. Avoids littering the current
directory (LP: #838361)
2011-09-04 19:01:01 +02:00
Stefano Rivera
abfdd76f01 ubuntutools.test.test_archive: Forgive newer python-debian's for calling
GpgInfo.from_sequence() with the optional keyrings arguments.
2011-08-16 11:19:15 +02:00
Benjamin Drung
e8b3a18c45 Move suspicious-source and wrap-and-sort from ubuntu-dev-tools into devscripts. 2011-05-23 23:41:00 +02:00
Stefano Rivera
7f311a2852 ubuntutools/archive.py: Rewrite launchpadlib redirects to https when
fetching dscs.
2011-02-13 14:40:14 +02:00
Stefano Rivera
4faba7c569 ubuntutools.archive: Handle source package in workdir correctly.
Add regression tests. (LP: #706403)
2011-01-22 23:19:31 +02:00
Stefano Rivera
bb718951ed Store blank example package extracted 2011-01-15 19:47:13 +02:00
Stefano Rivera
b11d08f6b0 Generate example package 2011-01-15 17:56:48 +02:00
Stefano Rivera
d9a9b4cab4 Complete test suite for ubuntutools.archive 2010-12-31 21:08:16 +02:00
Stefano Rivera
6b1ad27167 A bit less magic (for pylint) 2010-12-31 18:52:22 +02:00
Stefano Rivera
531aaba3a0 Basic test suite for ubuntutools.archive 2010-12-31 17:37:24 +02:00