~canonical-platform-qa/ubuntu-release-upgrader/fix-garbled-DistUpgradeViewNonInteractive-output

« back to all changes in this revision

Viewing changes to tests/test_quirks.py

  • Committer: Brian Murray
  • Date: 2015-10-27 20:44:48 UTC
  • Revision ID: brian@canonical.com-20151027204448-2l7ycoxfme1gjf47
add additional linux metapackage tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        self._verify_result_checksums()
95
95
 
96
96
    def test_patch_lowlevel(self):
97
 
        #test lowlevel too
 
97
        # test lowlevel too
98
98
        from DistUpgrade.DistUpgradePatcher import patch, PatchError
99
99
        self.assertRaises(PatchError, patch, CURDIR + "/patchdir/fail",
100
100
                          CURDIR + "/patchdir/patchdir_fail."
207
207
        pkgname = q._get_linux_metapackage(mock_cache, headers=False)
208
208
        self.assertEqual(pkgname, "linux-generic")
209
209
 
 
210
    def test_get_lpae_linux_metapackage(self):
 
211
        q = DistUpgradeQuirks(mock.Mock(), mock.Mock())
 
212
        mock_cache = set([
 
213
            make_mock_pkg(
 
214
                name="linux-image-4.2.0-16-generic-lpae",
 
215
                is_installed=True,
 
216
                candidate_rec={"Source": "linux"},
 
217
            ),
 
218
        ])
 
219
        pkgname = q._get_linux_metapackage(mock_cache, headers=False)
 
220
        self.assertEqual(pkgname, "linux-generic-lpae")
 
221
 
 
222
    def test_get_lowlatency_linux_metapackage(self):
 
223
        q = DistUpgradeQuirks(mock.Mock(), mock.Mock())
 
224
        mock_cache = set([
 
225
            make_mock_pkg(
 
226
                name="linux-image-4.2.0-16-lowlatency",
 
227
                is_installed=True,
 
228
                candidate_rec={"Source": "linux"},
 
229
            ),
 
230
        ])
 
231
        pkgname = q._get_linux_metapackage(mock_cache, headers=False)
 
232
        self.assertEqual(pkgname, "linux-lowlatency")
 
233
 
 
234
    def test_get_lts_linux_metapackage(self):
 
235
        q = DistUpgradeQuirks(mock.Mock(), mock.Mock())
 
236
        mock_cache = set([
 
237
            make_mock_pkg(
 
238
                name="linux-image-3.13.0-24-generic",
 
239
                is_installed=True,
 
240
                candidate_rec={"Source": "linux-lts-quantal"},
 
241
            ),
 
242
        ])
 
243
        pkgname = q._get_linux_metapackage(mock_cache, headers=False)
 
244
        self.assertEqual(pkgname, "linux-generic-lts-quantal")
 
245
 
210
246
 
211
247
if __name__ == "__main__":
212
248
    import logging