def test_parse(self): """ Parsing an SVN log in XML format. """ entries = svnclient.parse_svn_log_xml(svn_log_xml) eq_(len(entries), 2) e = entries[0] eq_(e['author'], 'apitrou') eq_(e['revision'], 1777) eq_utc_timestamp(e['date'], (2007, 3, 29, 9, 37, 56)) eq_(e['message'], "move dir to better-named location\n\n") paths = e['changed_paths'] eq_(len(paths), 2) p = paths[0] eq_(p, { 'path': '/hgsvn', 'action': 'A', 'copyfrom_path': '/scripts', 'copyfrom_revision': 1776, }) p = paths[1] eq_(p, { 'path': '/scripts', 'action': 'D', 'copyfrom_path': None, 'copyfrom_revision': None, }) e = entries[1] eq_(e['author'], 'apitrou') eq_(e['revision'], 1776) eq_utc_timestamp(e['date'], (2007, 3, 28, 16, 51, 15)) eq_(len(e['changed_paths']), 1)
def test_parse(self): """ Parsing an SVN log in XML format. """ entries = svnclient.parse_svn_log_xml(svn_log_xml) eq_(len(entries), 2) e = entries[0] eq_(e['author'], 'apitrou') eq_(e['revision'], 1777) eq_utc_timestamp(e['date'], (2007, 3, 29, 9, 37, 56)) eq_(e['message'], "move dir to better-named location\n\n") paths = e['changed_paths'] eq_(len(paths), 2) p = paths[0] eq_( p, { 'path': '/hgsvn', 'action': 'A', 'copyfrom_path': '/scripts', 'copyfrom_revision': 1776, }) p = paths[1] eq_( p, { 'path': '/scripts', 'action': 'D', 'copyfrom_path': None, 'copyfrom_revision': None, }) e = entries[1] eq_(e['author'], 'apitrou') eq_(e['revision'], 1776) eq_utc_timestamp(e['date'], (2007, 3, 28, 16, 51, 15)) eq_(len(e['changed_paths']), 1)
def test_parse_with_empty_msg(self): """ Parsing an SVN log entry with an empty commit message. """ entries = svnclient.parse_svn_log_xml(svn_log_xml_with_empty_msg) eq_(len(entries), 1) e = entries[0] eq_(e['message'], "")
def test_parse_with_invalid_xml(self): """ Parsing an SVN log entry with invalid XML characters. """ entries = svnclient.parse_svn_log_xml(svn_log_xml_with_invalid_chars) eq_(len(entries), 1) msg = entries[0]['message'] assert msg.startswith('fixed some plugin bugs===+=') assert msg.strip().endswith('---')
def test_parse_with_path_based_restrictions(self): # Stub log entries appear when there is path-based authentication # enabled on specific directories. entries = svnclient.parse_svn_log_xml(svn_log_xml_with_path_restricted) eq_(len(entries), 3) msg = entries[1]['message'] assert msg.startswith('Added bar.') keys = ('revision', 'author', 'date', 'message', 'changed_paths') eq_(set(keys), set(entries[0])) eq_([], entries[0]['changed_paths'])