~mvo/unattended-upgrades/hooks

« back to all changes in this revision

Viewing changes to test/test_origin_pattern.py

  • Committer: Michael Vogt
  • Date: 2013-01-16 07:47:22 UTC
  • mfrom: (252.2.2 glob-support)
  • Revision ID: michael.vogt@ubuntu.com-20130116074722-7m017nk9mlq4chvy
mergedĀ lp:~mvo/unattended-upgrades/support-glob-in-matchers

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
        pkg.candidate.record = {}
122
122
        return pkg
123
123
 
 
124
    def test_match_whitelist_wildcard(self):
 
125
        origin = self._get_mock_origin(
 
126
            "OriginUbuntu", "LabelUbuntu", "ArchiveUbuntu",
 
127
            "archive.ubuntu.com", "main")
 
128
        # good
 
129
        s="o=OriginU*"
 
130
        self.assertTrue(match_whitelist_string(s, origin))
 
131
        # bad
 
132
        s="o=X*"
 
133
        self.assertFalse(match_whitelist_string(s, origin))
 
134
        # good
 
135
        s="o=?riginUbunt?"
 
136
        self.assertTrue(match_whitelist_string(s, origin))
 
137
        # good
 
138
        s="o=*Ubunt?"
 
139
        self.assertTrue(match_whitelist_string(s, origin))
 
140
 
124
141
 
125
142
if __name__ == "__main__":
126
143
    logging.basicConfig(level=logging.DEBUG)