def test_dumps_to_plist(self): with open(self.filepath, 'rb') as f: sc = Shortcut.load(f, file_format=FMT_TOML) mocked_uuid = mock.Mock() mocked_uuid.uuid4.return_value = 'some-id' with mock.patch('shortcuts.shortcut.uuid', mocked_uuid): plist = sc.dumps(file_format=FMT_SHORTCUT) assert plist == self.exp_plist
def test_loads(self): with open(self.filepath, 'rb') as f: sc = Shortcut.load(f, file_format=FMT_TOML) assert [a.itype for a in sc.actions] == self.exp_itypes