_parse_string,
_unescape_value,
)
-from dulwich.tests import TestCase
+from dulwich.tests import (
+ TestCase,
+ )
class ConfigFileTests(TestCase):
cf = self.from_file(b"[branch.foo] foo = bar\n")
self.assertEqual(b"bar", cf.get((b"branch", b"foo"), b"foo"))
+ #@expectedFailure
def test_quoted(self):
cf = self.from_file(b"""[gui]
fontdiff = -family \\\"Ubuntu Mono\\\" -size 11 -weight normal -slant roman -underline 0 -overstrike 0
list(cd.itersections()))
-
class StackedConfigTests(TestCase):
def test_default_backends(self):
StackedConfig.default_backends()
-class UnescapeTests(TestCase):
-
- def test_nothing(self):
- self.assertEqual(b"", bytes(_unescape_value(bytearray())))
-
- def test_tab(self):
- self.assertEqual(b"\tbar\t", bytes(_unescape_value(bytearray(b"\\tbar\\t"))))
-
- def test_newline(self):
- self.assertEqual(b"\nbar\t", bytes(_unescape_value(bytearray(b"\\nbar\\t"))))
-
- def test_quote(self):
- self.assertEqual(b"\"foo\"", bytes(_unescape_value(bytearray(b"\\\"foo\\\""))))
-
-
class EscapeValueTests(TestCase):
def test_nothing(self):
self.assertEqual(b'foo', _parse_string(b"foo"))
self.assertEqual(b'foo bar', _parse_string(b"foo bar"))
+ def test_nothing(self):
+ self.assertEqual(b"", _parse_string(b''))
+
+ def test_tab(self):
+ self.assertEqual(b"\tbar\t", _parse_string(b"\\tbar\\t"))
+
+ def test_newline(self):
+ self.assertEqual(b"\nbar\t", _parse_string(b"\\nbar\\t\t"))
+
+ def test_quote(self):
+ self.assertEqual(b"\"foo\"", _parse_string(b"\\\"foo\\\""))
+
class CheckVariableNameTests(TestCase):