def test_get_curtin_kernel_cmdline_sep_returns_default(self): original_sep = getattr(kernel_opts.curtin, CURTIN_KERNEL_CMDLINE_NAME, sentinel.missing) if original_sep != sentinel.missing: def restore_sep(): setattr(kernel_opts.curtin, CURTIN_KERNEL_CMDLINE_NAME, original_sep) self.addCleanup(restore_sep) delattr(kernel_opts.curtin, CURTIN_KERNEL_CMDLINE_NAME) self.assertEqual('--', get_curtin_kernel_cmdline_sep())
def test_get_curtin_kernel_cmdline_sep_returns_curtin_value(self): sep = factory.make_name('separator') self.patch(kernel_opts.curtin, CURTIN_KERNEL_CMDLINE_NAME, sep) self.assertEqual(sep, get_curtin_kernel_cmdline_sep())