def test_with_backslashes(self): expected = {'andthis': r'has a f*****g \backslash in it'} line = r'[andthis:"has a f*****g \\backslash in it"]' r = decode_task(line) eq_(r, expected) r = decode_task(encode_task(decode_task(line))) eq_(r, expected)
def test_with_backticks(self): expected = {'this': r'has a f*****g `backtick` in it'} line = r'[this:"has a f*****g `backtick` in it"]' r = decode_task(line) eq_(r, expected) r = decode_task(encode_task(decode_task(line))) eq_(r, expected)
def test_with_unicode(self): expected = { six.text_type('andthis'): ( six.text_type('has a f*****g \\backslash in it') ) } line = r'[andthis:"has a f*****g \\backslash in it"]' r = decode_task(line) eq_(r, expected) r = decode_task(encode_task(decode_task(line))) eq_(r, expected)
def test_double_composition(self): eq_(TASK, decode_task(encode_task(decode_task(encode_task(TASK)))))
def test_decode_leading_whitespace_in_value(self): r = decode_task(encode_task(TASK_LEADING_WS)) eq_(r, TASK_LEADING_WS)
def test_decode(self): r = decode_task(encode_task(TASK)) eq_(r, TASK)
def test_with_escaped_quotes_full(self): line = r'[this:"has a \"quote\" in it."]' r = encode_task(decode_task(line)) eq_(r, r)
def test_no_side_effects(self): orig = TASK.copy() decode_task(encode_task(TASK)) eq_(orig, TASK)
def test_with_escaped_quotes_roundtrip(self): expected = {'this': r'has a "quote" in it.'} line = r'[this:"has a \"quote\" in it."]' r = decode_task(encode_task(decode_task(line))) eq_(r, expected)
def test_with_escaped_quotes(self): expected = {'this': r'has a \"quote\" in it.'} line = r'[this:"has a \"quote\" in it."]' r = decode_task(line) eq_(r, expected)