~ubuntu-branches/debian/stretch/python-apt/stretch

« back to all changes in this revision

Viewing changes to tests/test_tagfile.py

  • Committer: Package Import Robot
  • Author(s): Julian Andres Klode, Julian Andres Klode, Michael Vogt, von, Michael Schaller
  • Date: 2015-06-11 22:38:31 UTC
  • Revision ID: package-import@ubuntu.com-20150611223831-1ichot1xx9gwjynu
Tags: 1.0.0~beta1
[ Julian Andres Klode ]
* tests/test_tagfile.py: Close files we opened to prevent leakage
  (Closes: #785337)
* doc/source/c++/api.rst: Upgrade syntax to use the new domain stuff
* doc/source/library/apt_pkg.rst: Fix indentation (Closes: #736119)
* sphinx docs: Fix remaining instances of old C syntax to use domains
* python/cache.cc: Handle deprecation of pkgCache::PkgIterator::Section()
* doc: Prepare for 1.0 release
* TagFile: Provide close() and context manager (Closes: #748922)
* doc: Document apt_pkg.TagFile additions
* doc: templates: layout: Remove invalid icon links
* debian/control: Build-Depend on dh-python
* Do not link documentation from Architecture: all to Architecture: any
* Use ${python:Depends} and friends for the debug packages
* apt.debfile: Fix splitting of multi-lines Binary fields in dsc files
  (Closes: #751770)
* Remove apt.progress.gtk2
* apt_pkg.Package: Drop the unset 'auto' attribute (Closes: #565364)
* Update POTFILES.in and the pot
* apt/cache.py: Work around a cyclic reference from Cache to its methods
  (Closes: #745487)
* apt/debfile.py: Arch-qualify in compare_to_version_in_cache()
  (Closes: #750189)
* apt.package: Only reference Launchpad for missing changelogs on Ubuntu
  (Closes: #781270)
* apt/cache.py: Support :all and other special architecture specifies
* apt/debfile: Stop special-casing all when looking for a package in the cache
* apt/debfile.py: Allow downgrading packages in check() with a parameter
  (Closes: #613974)
* Acquire: Document that items may have transient errors on run() success
  (Closes: #680997)
* Large file support (Closes: #742885)
  - python/arfile.cc: Do not allow files larger than SIZE_MAX to be mapped
  - python/arfile.cc: LFS: Use long long instead of long for file sizes
  - python/tarfile.cc: LFS: Handle too large file
* setup.py: Translate version number from Debian to PEP0440 (LP: #1445949)

[ Michael Vogt ]
* apt_pkg.rst: improve documentation for AcquireFile() hash and add
  sha512 to the documentation
* rename "md5" keyword argument in AcquireFile() to "hash" and add
  backward compatiblity
* Fix apt.Package.installed_files for multi-arch packages (LP: #1313699)

[ von ]
* Remove the "-Wstrict-prototypes" compiler option (Closes: #785261)
* Set Standards-Version to 3.9.6 (Closes: #785431)
* Fix indentation and docstring problems (Closes: #784910)

[ Michael Schaller ]
* Fixed docstring of BaseDependency.version property.
* Improved docstring of the Version.get_dependencies method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        basepath = os.path.dirname(__file__)
35
35
        fd = apt_pkg.open_maybe_clear_signed_file(
36
36
            os.path.join(basepath, "./data/test_debs/hello_2.5-1.dsc"))
37
 
        f = os.fdopen(fd)
38
 
        data = f.read()
 
37
        with os.fdopen(fd) as f:
 
38
            data = f.read()
39
39
        self.assertTrue(data.startswith("Format: 1.0\n"))
40
40
 
41
41
    def test_open_normal(self):
42
42
        basepath = os.path.dirname(__file__)
43
43
        fd = apt_pkg.open_maybe_clear_signed_file(
44
44
            os.path.join(basepath, "./data/misc/foo_Release"))
45
 
        f = os.fdopen(fd)
46
 
        data = f.read()
 
45
        with os.fdopen(fd) as f:
 
46
            data = f.read()
47
47
        self.assertTrue(data.startswith("Origin: Ubuntu\n"))
48
48
 
49
49
    def xtest_open_does_not_exit(self):