def _get_launch_attributes(self):
     """Return launch attributes in the format supported by the rp."""
     attributes = self._cfg.launch_attributes or []
     system_attributes = get_launch_sys_attrs()
     system_attributes["agent"] = "{}-{}".format(self.agent_name,
                                                 self.agent_version)
     return attributes + _dict_to_payload(system_attributes)
def test_get_launch_sys_attrs_docker():
    """Test that cpu key value is not empty.

    platform.processor() returns empty string in case it was called
    inside of the Docker container. API does not allow empty values
    for the attributes.
    """
    result = get_launch_sys_attrs()
    assert result['cpu'] == 'unknown'
def test_get_launch_sys_attrs():
    """Test for validate get_launch_sys_attrs function."""
    expected_result = {
        'cpu': 'amd',
        'machine': 'Windows-PC',
        'os': 'linux',
        'system': True
    }
    assert get_launch_sys_attrs() == expected_result
Beispiel #4
0
    def _get_launch_attributes(cmd_attrs):
        """Generate launch attributes including both system and user ones.

        :param list cmd_attrs: List for attributes from the pytest.ini file
        """
        attributes = cmd_attrs or []
        system_info = get_launch_sys_attrs()
        system_attributes = _dict_to_payload(system_info)
        return attributes + system_attributes
Beispiel #5
0
    def _get_launch_attributes(self, ini_attrs):
        """Generate launch attributes in the format supported by the client.

        :param list ini_attrs: List for attributes from the pytest.ini file
        """
        attributes = ini_attrs or []
        system_attributes = get_launch_sys_attrs()
        system_attributes['agent'] = ('{}-{}'.format(self.agent_name,
                                                     self.agent_version))
        return attributes + _dict_to_payload(system_attributes)
    def _get_launch_attributes(self, cmd_attrs):
        """Generate launch attributes including both system and user ones.

        :param list cmd_attrs: List for attributes from the command line
        """
        attributes = cmd_attrs or []
        system_attributes = get_launch_sys_attrs()
        system_attributes['agent'] = ('{}-{}'.format(self.agent_name,
                                                     self.agent_version))
        return attributes + _dict_to_payload(system_attributes)