Lowercase format vars. Add Chinese character test
This commit is contained in:
parent
dccbadaf73
commit
11c74f1ffe
@ -25,7 +25,7 @@ def command(conf, args):
|
||||
if args.append is None:
|
||||
ui.edit_file(notepath, temporary=False)
|
||||
else:
|
||||
latestnote = '{TXT}\n'.format(TXT=args.append)
|
||||
latestnote = '{txt}\n'.format(txt=args.append)
|
||||
write_file(notepath, latestnote, 'a')
|
||||
NoteEvent(citekey).send()
|
||||
rp.close()
|
||||
|
@ -34,6 +34,11 @@ class TestNoteAppend(DataCommandTestCase):
|
||||
self.execute_cmds(cmds)
|
||||
note_lines.append('bbb')
|
||||
self.assertFileContentEqual(fin_notes, self._get_note_content(note_lines))
|
||||
# Test adding Chinese characters
|
||||
cmds = [('pubs note Page99 -a \347\350\346\345')]
|
||||
self.execute_cmds(cmds)
|
||||
note_lines.append('\347\350\346\345')
|
||||
self.assertFileContentEqual(fin_notes, self._get_note_content(note_lines))
|
||||
# # Test adding Japanese character
|
||||
# cmds = [('pubs note Page99 -a ソ')]
|
||||
# self.execute_cmds(cmds)
|
||||
@ -43,7 +48,7 @@ class TestNoteAppend(DataCommandTestCase):
|
||||
@staticmethod
|
||||
def _get_note_content(note_lines):
|
||||
"""Given a list of note lines, return full note file content"""
|
||||
return '{LINES}\n'.format(LINES='\n'.join(note_lines))
|
||||
return '{lines}\n'.format(lines='\n'.join(note_lines))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user