~ubuntu-core-dev/ubuntu/xenial/ubuntu-release-upgrader/xenial

« back to all changes in this revision

Viewing changes to tests/test_sources_list.py

  • Committer: Dimitri John Ledkov
  • Date: 2015-01-20 22:30:06 UTC
  • mto: This revision was merged to the branch mainline in revision 2859.
  • Revision ID: dimitri.j.ledkov@intel.com-20150120223006-ba30fbqtp4x2n0og
Fix resource warnings & logging.warn deprecation warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
454
454
 
455
455
    def _verifySources(self, expected):
456
456
        sources_file = apt_pkg.config.find_file("Dir::Etc::sourcelist")
457
 
        sources_list = open(sources_file).read()
 
457
        with open(sources_file) as f:
 
458
            sources_list = f.read()
458
459
        for l in expected.split("\n"):
459
460
            self.assertTrue(
460
461
                l in sources_list.split("\n"),