summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2015-06-21fix py3 issue with auto .gz decompression and add testMichael Vogt2-0/+5
2015-06-16tests/test_paths.py: Add an 'always' warning filter, so it is reliableJulian Andres Klode1-2/+6
Previously, the warning was not always issued, causing the test to fail in some cases. Also change the assertions to use the assert* methods of unittest, and check that md5 and hash are mentioned in the deprecation message. Thanks: Adam Conrad Gbp-Dch: ignore
2015-06-16tests/test_paths.py: Fix indentationJulian Andres Klode1-4/+4
Geany misdetected it as 8 spaces, but it should be 4. Gbp-Dch: ignore
2015-06-16tests/test_paths.py: Catch and assert the DeprecationWarningJulian Andres Klode1-4/+10
This fixes Ubuntu autopkg test failure wily-adt-python-apt #12. https://jenkins.qa.ubuntu.com/job/wily-adt-python-apt/12/
2015-06-11tests/test_large_file.py: make pep8 happyJulian Andres Klode1-1/+2
The spacing around the ** operator looks ugly, and that's fixed in pep8 1.6.0, but we only have 1.5.7. Gbp-Dch: ignore
2015-06-11python/tarfile.cc: LFS: Handle too large fileJulian Andres Klode2-0/+22
Handle both file sizes larger than SIZE_MAX and allocation failures when reading the data of a tarmember. If using the go() function with a callback, pass None as the data parameter for files that are too large. For extractdata, raise a MemoryError if the file too extract is too large. Also check for an existing error first in extractdata, before raising a new one. Test the whole thing on 32-bit platforms with a sample deb that contains a zeroed file that is 5GB large (compressed using xz at level 1 to a few kb).
2015-06-10apt.debfile: Fix splitting of multi-lines Binary fields in dsc filesJulian Andres Klode2-3/+4
In a multi-line field, a comma might be followed by a newline instead of a space. Closes: #751770
2015-05-22rename "md5" keyword argument in AcquireFile() to "hash" and add backward ↵Michael Vogt1-0/+14
compatiblity
2015-05-15tests/test_tagfile.py: Close files we opened to prevent leakageJulian Andres Klode1-4/+4
This bug was initially experienced in the Ubuntu automatic package testing environment, and they fixed it in 0.9.4ubuntu1 with the same (obvious) patch. The bug was reported in Debian as #785337 with a different patch. Compared to the patch suggested in the bug tracker, this version is more idiomatic Python. Closes: #785337
2014-11-07apt/debfile.py: use apt_pkg.open_maybe_clear_signed_file() when opening a ↵Michael Vogt1-2/+2
.dsc file
2014-11-06Add binding for apt_pkg.maybe_open_clear_signed_file()Michael Vogt1-0/+23
2014-11-06add apt_pkg.sha512sum()Michael Vogt1-0/+25
2014-09-03read all tags from a dsc file and improve testsMichael Vogt1-7/+21
2014-09-03add support for apt.debfile.DscSrcPackage.filelistMichael Vogt1-0/+4
2014-09-02Stop reading after the "Format" stanza in a .dsc fileMichael Vogt1-0/+1
This makes the tagfile parser skip the last gpg signature part that also contains a "Version:" line.
2014-08-28tests/test_auth.py: update for gnupg 1.4.18Mauricio Faria de Oliveira1-1/+4
The test 'test_add_key_from_server_mitm' needs updating for gnupg 1.4.18 which fail differently/earlier when 'fingerprints do not match' since commit 'Screen keyserver responses' (5230304349490f31aa64ee2b69a8a2bc06bf7816) With that change gnupg actually checks itself(!) if the key that the server send matches the key that the user asked for. Closes: #755342
2014-08-28tests/test_pep8.py: --ignore E129 too (fix FTBFS with pep8 >= 1.5)Mauricio Faria de Oliveira1-1/+3
2014-07-04fix another pep8 failureMichael Vogt1-1/+1
2014-06-30make pep8 happy (again)Michael Vogt3-21/+22
2014-06-10Revert "Merge remote-tracking branch 'mvo/feature/srcrec-enum' into debian/sid"Michael Vogt1-24/+0
This reverts commit 1b6b123a052ca2d53e90b62da09ce300d701265a, reversing changes made to 9de6a183f09f0d0adbcc5817872c5a0024f5ef47.
2014-06-10Merge remote-tracking branch 'mvo/feature/srcrec-enum' into debian/sidMichael Vogt1-0/+24
Conflicts: debian/control
2014-03-22tests: Drop some more Python 2.6 cruftJulian Andres Klode2-19/+1
We do not support Python 2.6 anymore, so we can get rid of this.
2014-03-17Support all compressors for data.tar/control.tar (Closes: #718330)Julian Andres Klode4-4/+10
This makes our support very flexible, and open for future additions of new compression algorithms. debfile_extract_tar() is almost identical to ExtractTarMember() of apt's debDebFile.
2014-02-22tests/test_policy.py: Fix comment to conform to PEP8Julian Andres Klode1-2/+2
2014-02-22tests/data/aptsources/sources.list.testDistribution: Add tangluJulian Andres Klode1-0/+1
2014-02-22tests/test_policy.py: Disable, uses system state (FTBFS on ppc64)Julian Andres Klode1-0/+2
Disable the tests until we can fix them properly.
2014-01-25tests/test_deps.py: test_dstr cleanup and fixesJulian Andres Klode1-22/+13
Simplify the code by not stating all test cases in the code, but using a loop. Also adds more tests this way.
2014-01-23tests/test_aptsources.py: Fix regression in d95a8f2Julian Andres Klode1-1/+1
Commit d95a8f27774842beb43bda54c4c61b67fe76a032 introduced a regression in this test that did not catch an invalid False value for the trusted property of a source without trusted set.
2014-01-07tests: Add back test_hashsums from old and updateJulian Andres Klode3-24/+27
These are automatic tests and they still work, so it's pointless not to use them.
2014-01-06tests/test_deps.py: Remove an invalid blank lineJulian Andres Klode1-1/+0
Fixes pep8
2014-01-06apt/package.py: Fix BaseDependency.__dstr.__ne__()Julian Andres Klode1-0/+28
It turns out I missed this. Just simplify it to return not self.__eq__(other). Also add a test case for it. Reported-by: Michael Schaller <michael@5challer.de>
2014-01-06tests: Remove checks for Python older than 2.7Julian Andres Klode3-24/+5
This simplifies the test code a tiny bit.
2014-01-06Drop support for Python 2.6Julian Andres Klode1-9/+2
This will allow us to use more Python 3 idioms in the code, and possibly even get a single code base that works in Python 2.7 and Python 3.3 and newer.
2014-01-06Style fix: Do not use "is True" / "is False"Julian Andres Klode1-2/+2
This is uncommon style. It's better to use "pred" instead of "pred is True" and "not pred" instead of "pred is False".
2014-01-05make test_pep8.py passMichael Vogt24-150/+176
2014-01-05make pyflakes cleanMichael Vogt9-21/+5
2014-01-05add pyflakes testMichael Vogt1-0/+41
2014-01-05make pep8 test part of the unittestsMichael Vogt1-0/+27
2013-10-21tests/old/*.py: Update to new API as wellJulian Andres Klode11-110/+110
2013-10-21aptsources: Correctly parse multiple options (LP: #1103200)Julian Andres Klode2-2/+20
It's still not optimal and we do not support the arch+ and arch- options, but it's a beginning.
2013-10-21apt/debfile.py: Pass strip_multi_arch=False to parse_depends.Julian Andres Klode4-0/+56
Patch by Michael, tests derived from the ones provided by the reporter. I included the test debs without the source package, as for our use case, all needed "source code" is included in the package itself anyway. Reported-By: Francois Gouget <fgouget@free.fr> Closes: #717859 Closes: #717861
2013-10-14tests/test_path.py: Use "Dir" option instead of "RootDir", and reset in tearDownJulian Andres Klode1-3/+3
This fixes tests/test_all.py.
2013-10-14Add tests for (all except one) functions accepting pathsJulian Andres Klode1-0/+106
Test the functions with a unicode and a byte object each. I ignore PackageManager.install, because I cannot imagine an easy way to test that one.
2013-10-14python/indexrecords.cc: IndexRecords.load() needs to accept bytes as wellJulian Andres Klode1-0/+29
2013-10-10tests: Do not set dir::etc::sourceparts to /tmpJulian Andres Klode2-2/+4
This can cause build failures if *.list files are present in /tmp. Use /dev/null instead (not a directory, but APT silently ignores this).
2013-06-06add support for "key in apt.debfile.DebPackage" (closes: #710541)Michael Vogt1-0/+4
2013-03-13python2.6 compat fixesMichael Vogt1-1/+8
2012-11-20tests/test_auth.py: Temporarily disable $http_proxy for the tests, asMartin Pitt1-0/+11
gnupg does not get along with proxies (LP #789049)
2012-11-20tests/test_auth.py: In test_add_key_from_server_mitm(), show the exceptionMartin Pitt1-1/+1
if it does not match the expectation, so that this becomes possible to debug.
2012-11-20tests/*.py: Do not prepend None to sys.path, Python 3.3 redeems that withMartin Pitt4-4/+12
an unintelligible crash.