Repository: reportportal/client-Python

Issue:
Duplicate agent name in agent name attached as system information
```
# python
Python 3.6.5 (default, Apr 10 2018, 17:08:37) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from reportportal_client.service import ReportPortalService
>>> ReportPortalService.get_system_information('pytest-reportportal')
{'agent': 'pytest-reportportal-pytest-reportportal 5.0.2', 'os': 'Linux', 'cpu': 'x86_64', 'machine': 'x86_64'}
```


Discussion:

Patch:
diff --git a/reportportal_client/service.py b/reportportal_client/service.py
index 2bd83c9..43bde6b 100644
--- a/reportportal_client/service.py
+++ b/reportportal_client/service.py
@@ -475,7 +475,8 @@ class ReportPortalService(object):
                        'machine': "Windows10_pc"}
         """
         try:
-            agent_version = pkg_resources.get_distribution(agent_name)
+            agent_version = pkg_resources.get_distribution(
+                agent_name).version
             agent = '{0}-{1}'.format(agent_name, agent_version)
         except pkg_resources.DistributionNotFound:
             agent = 'not found'


Test patch:
diff --git a/tests/test_service.py b/tests/test_service.py
index 9d57f80..8dc178c 100644
--- a/tests/test_service.py
+++ b/tests/test_service.py
@@ -83,24 +83,23 @@ class TestReportPortalService:
         :param rp_service: Pytest fixture
         """
         mock_get.return_value = {"id": 111}
-        _get_msg = rp_service.finish_launch('name', datetime.now().isoformat())
+        _get_msg = rp_service.finish_launch(
+            'name', datetime.now().isoformat())
         assert _get_msg == {"id": 111}
 
     @mock.patch('platform.system', mock.Mock(return_value='linux'))
     @mock.patch('platform.machine', mock.Mock(return_value='Windows-PC'))
     @mock.patch('platform.processor', mock.Mock(return_value='amd'))
-    @mock.patch('pkg_resources.get_distribution',
-                mock.Mock(return_value='pytest 5.0'))
-    def test_get_system_information(self):
+    @mock.patch('pkg_resources.get_distribution')
+    def test_get_system_information(self, distro):
         """Test for validate get_system_information."""
-
-        expected_result = {'agent': 'pytest-pytest 5.0',
+        distro.return_value.version = '5.0'
+        expected_result = {'agent': 'reportportal-client-5.0',
                            'cpu': 'amd',
                            'machine': 'Windows-PC',
                            'os': 'linux'}
-
-        cond = (ReportPortalService.get_system_information('pytest')
-                == expected_result)
+        cond = (ReportPortalService.get_system_information(
+            'reportportal-client') == expected_result)
         assert cond
 
     @mock.patch('platform.system', mock.Mock())