Skip to content

Commit

Permalink
started to implement TestChangeRecords.test_bad_change_records()
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Jul 24, 2016
1 parent 6b82a82 commit 9f889bb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Tests/t_ldif.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
See http://www.python-ldap.org/ for details.
$Id: t_ldif.py,v 1.19 2016/07/17 19:37:37 stroeder Exp $
$Id: t_ldif.py,v 1.20 2016/07/24 14:57:46 stroeder Exp $
"""

# from Python's standard lib
Expand Down Expand Up @@ -479,6 +479,23 @@ def test_missing_trailing_separator(self):
],
)

def test_bad_change_records(self):
for bad_ldif_string in (
"""
changetype: modify
replace: attrib
attrib: value
attrib: value2
""",
):
ldif_string = textwrap.dedent(bad_ldif_string).lstrip() + '\n'
try:
res = self._parse_records(ldif_string)
except ValueError, value_error:
pass
else:
self.fail("should have raised ValueError: %r" % ldif_str)


if __name__ == '__main__':
unittest.main()

0 comments on commit 9f889bb

Please sign in to comment.