~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: Michael Vogt
  • Date: 2008-11-14 19:03:53 UTC
  • Revision ID: michael.vogt@ubuntu.com-20081114190353-tnrwn4pvarb9gxyb
* debian/rules 
  - remove the arch-build target
* DistUpgrade/DistUpgradeController.py:
  - improvements to the sources.list rewriting, better tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        if os.path.exists(os.path.join(self.testdir, "sources.list")):
24
24
            os.unlink(os.path.join(self.testdir, "sources.list"))
25
25
 
 
26
    def test_sources_list_with_nothing(self):
 
27
        """
 
28
        test sources.list rewrite with nothing in it
 
29
        """
 
30
        shutil.copy(os.path.join(self.testdir,"sources.list.nothing"),
 
31
                    os.path.join(self.testdir,"sources.list"))
 
32
        apt_pkg.Config.Set("Dir::Etc::sourcelist","sources.list")
 
33
        v = DistUpgradeViewNonInteractive()
 
34
        d = DistUpgradeController(v,datadir=self.testdir)
 
35
        d.openCache(lock=False)
 
36
        res = d.updateSourcesList()
 
37
        self.assert_(res == True)
 
38
 
 
39
        # now test the result
 
40
        print open(os.path.join(self.testdir,"sources.list")).read()
 
41
        self._verifySources("""
 
42
deb http://archive.ubuntu.com/ubuntu gutsy main restricted
 
43
deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted
 
44
deb http://security.ubuntu.com/ubuntu/ gutsy-security main restricted
 
45
""")
 
46
 
26
47
    def test_sources_list_rewrite(self):
27
48
        """
28
49
        test regular sources.list rewrite