Skip to content

Commit

Permalink
QAWTO-6 library fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
angel-ram committed Dec 18, 2020
1 parent 7337877 commit 9fa87ef
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -4,3 +4,4 @@ Appium-Python-Client>=0.24,<1 # mobile tests
six>=1.10.0
screeninfo==0.3.1
typing==3.7.4.1
lxml==4.5.0
2 changes: 1 addition & 1 deletion toolium/test/utils/test_download_files.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
u"""
Copyright 2018 Telefónica Investigación y Desarrollo, S.A.U.
Copyright 2020 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
28 changes: 21 additions & 7 deletions toolium/utils/download_files.py
@@ -1,24 +1,38 @@
# -*- coding: utf-8 -*-

# Copyright (c) Telefónica Digital.
# QA Team <qacdco@telefonica.com>

u"""
Copyright 2020 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import difflib
import filecmp
import os
import time

try:
from urllib import urlretrieve, urlopen # Py2
from urlparse import urljoin
except ImportError:
from urllib.request import urlretrieve, urlopen # Py3
from urllib import parse
from urllib.parse import urljoin

import requests
from lxml import html

from toolium.driver_wrappers_pool import DriverWrappersPool
from toolium.path_utils import makedirs_safe
from toolium.selenoid import Selenoid


DOWNLOADS_SERVICE_PORT = 8001
DOWNLOADS_FOLDER = 'downloads'
Expand Down Expand Up @@ -123,7 +137,7 @@ def _get_download_directory_url(context):
remote_node = _get_remote_node_for_download(context)
if context.download_directory:
host = 'http://{}:{}'.format(remote_node, DOWNLOADS_SERVICE_PORT)
url = parse.urljoin(host, context.download_directory)
url = urljoin(host, context.download_directory)
else:
url = 'http://{}:{}'.format(remote_node, DOWNLOADS_SERVICE_PORT)
return url
Expand Down

0 comments on commit 9fa87ef

Please sign in to comment.