Suppress the Cloudpinyin first-use prompt
This commit is contained in:
1 parent
036e501e58
commit
f273eed840
5 files changed
+29
-7
No files matched your search
@@ -16,6 +16,19 @@ spec.loader.exec_module(setup)
|
||||
|
||||
|
||||
class InputMethodTest(unittest.TestCase):
|
||||
def test_pinyin_defaults_suppress_cloud_prompt(self):
|
||||
setup.defaults(self.config, fresh=True)
|
||||
pinyin = setup.values((self.config / "fcitx5/conf/pinyin.conf").read_text())
|
||||
self.assertEqual(pinyin["FirstRun"], "False")
|
||||
self.assertEqual(pinyin["CloudPinyinEnabled"], "False")
|
||||
|
||||
def test_pinyin_prompt_suppression_preserves_existing_preferences(self):
|
||||
pinyin = self.config / "fcitx5/conf/pinyin.conf"
|
||||
pinyin.parent.mkdir(parents=True)
|
||||
pinyin.write_text("FirstRun=True\nCloudPinyinEnabled=True\nPageSize=7\n")
|
||||
setup.defaults(self.config)
|
||||
self.assertEqual(pinyin.read_text(), "FirstRun=False\nCloudPinyinEnabled=True\nPageSize=7\n")
|
||||
|
||||
def setUp(self):
|
||||
self.temporary = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(self.temporary.cleanup)
|
||||
|
||||
@@ -275,8 +275,6 @@ assertDeepEqual(JSON.parse(notifications.snapshotOf({ actions: [
|
||||
{ identifier: 'default', text: 'Open' }, { identifier: 'yes', text: 'Yes' }, { identifier: 'no', text: 'No' }
|
||||
]}).actionsJson), [{ identifier: 'yes', text: 'Yes' }, { identifier: 'no', text: 'No' }], 'explicit choices appear independently of the default card action')
|
||||
assertEqual(notifications.popupEntry({ actionsJson: '[{"identifier":"yes","text":"Yes"}]' }, 1).actionsJson, '[]', 'restored notifications do not replay actions from a dead sender')
|
||||
assertEqual(notifications.snapshotOf({ appName: 'Pinyin', appIcon: 'fcitx-pinyin', urgency: 1 }).urgency, 2, 'Pinyin prompts stay visible until dismissed')
|
||||
assertEqual(notifications.snapshotOf({ appName: 'Other', appIcon: 'fcitx-pinyin', urgency: 1 }).urgency, 1, 'other notification senders retain their urgency')
|
||||
assertDeepEqual(
|
||||
{
|
||||
id: snapshot.id,
|
||||
|
||||
Reference in new issue
Block a user