From 69ffbebe38883f9040120e2ce3c8851f573970f5 Mon Sep 17 00:00:00 2001 From: KOL Date: Wed, 12 Jun 2019 21:04:49 +0300 Subject: [PATCH] Fix parsing info with ":" symbol --- pyps4/ddp.py | 2 +- tests/test_ps4.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyps4/ddp.py b/pyps4/ddp.py index bedcdc3..b04c5ca 100644 --- a/pyps4/ddp.py +++ b/pyps4/ddp.py @@ -34,7 +34,7 @@ def parse_ddp_response(rsp): data[u'status_code'] = int(re_status.match(line).group('code')) data[u'status'] = re_status.match(line).group('status') else: - values = line.split(':') + values = line.split(':', 1) data[values[0]] = values[1] return data diff --git a/tests/test_ps4.py b/tests/test_ps4.py index a6764f3..c92c53a 100644 --- a/tests/test_ps4.py +++ b/tests/test_ps4.py @@ -80,7 +80,7 @@ def test_get_host_id(self): mock.side_effect = [ {'host-id': 'test-A'}, {'host-name': 'test-B'}, - {'running-app-titleid': 'test-C'}, + {'running-app-titleid': 'test-C: C'}, {'running-app-name': 'test-D'}, {'system-version': 'test-E'}, ] @@ -90,6 +90,6 @@ def test_get_host_id(self): eq_(playstation.get_host_id(), 'test-A') eq_(playstation.get_host_name(), 'test-B') - eq_(playstation.get_running_app_titleid(), 'test-C') + eq_(playstation.get_running_app_titleid(), 'test-C: C') eq_(playstation.get_running_app_name(), 'test-D') eq_(playstation.get_system_version(), 'test-E')