1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

add simple summary support to rsync and rsync-s parsers

This commit is contained in:
Kelly Brazil
2024-02-27 10:26:07 -08:00
parent f9bf889654
commit e2f97d7d8e
8 changed files with 106 additions and 10 deletions

View File

@ -161,6 +161,18 @@ class MyTests(unittest.TestCase):
"""
self.assertEqual(jc.parsers.rsync.parse(self.osx_10_14_6_rsync_i_vvv_logfile_nochange, quiet=True), self.osx_10_14_6_rsync_i_vvv_logfile_nochange_json)
def test_rsync_simple_summary(self):
"""
Test 'rsync avh' output with a simple summary
"""
data = '''sending incremental file list
sent 8.71M bytes received 29.88K bytes 10.99K bytes/sec
total size is 221.79G speedup is 25,388.23
'''
expected = [{"summary":{"sent":8710000,"received":29880,"bytes_sec":10990.0,"total_size":221790000000,"speedup":25388.23},"files":[]}]
self.assertEqual(jc.parsers.rsync.parse(data, quiet=True), expected)
if __name__ == '__main__':
unittest.main()