~mvo/unattended-upgrades/debian-sid-mirror

« back to all changes in this revision

Viewing changes to test/test_origin_pattern.py

  • Committer: Michael Vogt
  • Date: 2013-03-14 08:19:24 UTC
  • mfrom: (252.2.5 debian-experimental)
  • Revision ID: michael.vogt@ubuntu.com-20130314081924-kfoef52dyykovuvb
merged experimental branch (that is not really experimental)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
import unattended_upgrade
8
8
from unattended_upgrade import (
9
 
    match_whitelist_string,
10
9
    check_changes_for_sanity,
11
10
    is_allowed_origin,
 
11
    get_distro_codename,
 
12
    match_whitelist_string,
12
13
    UnknownMatcherError,
13
14
    )
14
15
 
61
62
        self.assertTrue("s=aSite,l=aLabel" in allowed_origins)
62
63
        self.assertTrue("o=Google\, Inc.,suite=stable" in allowed_origins)
63
64
 
 
65
    def test_macro(self):
 
66
        codename = get_distro_codename()
 
67
        s = "a=${distro_codename}"
 
68
        origin = self._get_mock_origin("Foo", archive=codename)
 
69
        self.assertTrue(match_whitelist_string(s, origin))
 
70
 
64
71
    def test_compatiblity(self):
65
72
        apt_pkg.config.clear("Unattended-Upgrade")
66
73
        apt_pkg.read_config_file(apt_pkg.config, "./data/50unattended-upgrades.compat")