def test_get_magic_marks(self): ms = get_magic_marks('.+') assert ms == ['+'] ms = get_magic_marks('.~') assert ms == ['~'] ms = get_magic_marks('.`a b`') assert ms == ['`a b`']
def test_get_magic_marks_bad_text(self): ms = get_magic_marks('') assert ms is None ms = get_magic_marks('foo') assert ms is None ms = get_magic_marks('.foo') assert ms is None ms = get_magic_marks('.foo+~``') assert ms is None
def test_get_magic_marks_multiple(self): ms = get_magic_marks('.+~`a b c`') assert ms == ['+', '~', '`a b c`']
def test_get_magic_marks_special(self): ms = get_magic_marks('++foo') assert ms == '++' ms = get_magic_marks('--foo\nbar') assert ms == '--'
def test_get_magic_marks_multiline(self): ms = get_magic_marks('.+foo\nbar') assert ms == ['+'] ms = get_magic_marks('++foo\nbar\nbaz') assert ms == '++'