~aptdaemon-developers/aptdaemon/1.x

« back to all changes in this revision

Viewing changes to tests/test_valid_package_names.py

  • Committer: Sebastian Heinlein
  • Date: 2012-12-29 23:41:16 UTC
  • mfrom: (883.1.26 pep8)
  • Revision ID: devel@glatzor.de-20121229234116-nd390n01ut2fcfce
PEP8 fixes and test for the test suite

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    def test_valid_package_names(self):
27
27
        # ensure that the code raises on invalid ones, note that we
28
28
        # test each item individually instead of the list because each
29
 
        # needs to raise 
 
29
        # needs to raise
30
30
        for invalid in [
31
 
            "foo_bar", "äää", "i space", "a", "+invalidstart", "noUpper", 
32
 
            "foo=", "foo=", "foo=a", "foo=0 space"
33
 
            "foo/", "foo/ space"]:
 
31
                "foo_bar", "äää", "i space", "a", "+invalidstart", "noUpper",
 
32
                "foo=", "foo=", "foo=a", "foo=0 space"
 
33
                "foo/", "foo/ space"]:
34
34
            with self.assertRaises(aptdaemon.errors.AptDaemonError):
35
35
                self.daemon._check_package_names([invalid])
36
36
 
39
39
                        "apt+:i386/unstable", "apt+:amd64=0.3.2"]:
40
40
            self.daemon._check_package_names([pkgname])
41
41
 
42
 
        # ensure the code does not wrongly label valid packages as 
 
42
        # ensure the code does not wrongly label valid packages as
43
43
        # invalid, _check_package_names will raise on error
44
44
        for pkg in self.cache:
45
45
            self.daemon._check_package_names([pkg.name])
49
49
            if not pkg.candidate:
50
50
                continue
51
51
            self.daemon._check_package_names(
52
 
                ["%s=%s" % (pkg.name,pkg.candidate.version)])
 
52
                ["%s=%s" % (pkg.name, pkg.candidate.version)])
53
53
 
54
54
        # test again, this time with release origin
55
55
        for pkg in self.cache: