Skip to content

Commit 8bd2742

Browse files
committed
chore: update deps
1 parent 31f07c7 commit 8bd2742

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

core/utils/file_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import stat
88

99
from core.log.log import Log
10+
from core.settings import Settings
1011

1112

1213
class Folder(object):
@@ -91,7 +92,10 @@ def read(path, log_content=False):
9192
if log_content:
9293
Log.info('Read ' + path + ':')
9394
Log.info(output)
94-
return output
95+
if Settings.PYTHON_VERSION < 3:
96+
return str(output.decode('utf8').encode('utf8')).strip()
97+
else:
98+
return output.decode("utf-8").strip()
9599
else:
96100
raise IOError("{0} not found!".format(path))
97101

core_tests/utils/file_tests.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import os
22
import unittest
33

4-
from settings import Settings
5-
from utils.file_utils import File
4+
from core.settings import Settings
5+
from core.utils.file_utils import File
66

77

88
# noinspection PyMethodMayBeStatic
99
class FileUtilsTests(unittest.TestCase):
10-
1110
def test_01_replace(self):
1211
# Path to files
1312
base_path = os.path.join(Settings.TEST_RUN_HOME, 'core_tests', 'utils')
@@ -18,19 +17,19 @@ def test_01_replace(self):
1817

1918
# Create new file (so we don't break original one).
2019
File.copy(src=old_scss, target=new_scss)
21-
assert len(File.read(path=new_scss).split('\n')) == 14, 'Unexpected lines count.'
20+
assert len(File.read(path=new_scss).splitlines()) == 14, 'Unexpected lines count.'
2221

2322
# Replace
2423
File.replace(path=new_scss, old_string=old_value, new_string=new_value)
2524
content = File.read(path=new_scss)
2625
assert 'red;' in content, 'Failed to replace string.'
27-
assert len(content.split('\n')) == 15, 'Unexpected lines count.'
26+
assert len(content.splitlines()) == 15, 'Unexpected lines count.'
2827

2928
# Revert
3029
File.replace(path=new_scss, old_string=new_value, new_string=old_value)
3130
content = File.read(path=new_scss)
3231
assert 'red;' not in content, 'Failed to replace string.'
33-
assert len(content.split('\n')) == 14, 'Unexpected lines count.'
32+
assert len(content.splitlines()) == 14, 'Unexpected lines count.'
3433

3534
File.clean(path=new_scss)
3635

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ aenum>=2.1.2
22
flaky>=3.4.0
33
psutil>=5.4.8
44
parameterized>=0.6.1
5+
nose-parameterized>=0.6.0
56
nose>=1.3.7
67
nose-html-reporting>=0.2.3
78
Pillow>=5.3.0

requirements_darwin.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ aenum>=2.1.2
22
flaky>=3.4.0
33
psutil>=5.4.8
44
parameterized>=0.6.1
5+
nose-parameterized>=0.6.0
56
nose>=1.3.7
67
nose-html-reporting>=0.2.3
78
Pillow>=5.3.0

tests/live/template_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import os
22

3-
from nose_parameterized import parameterized
3+
from parameterized import parameterized
44

5-
from const import Colors
65
from core.base_test.tns_test import TnsTest
76
from core.enums.env import EnvironmentType
87
from core.enums.os_type import OSType
98
from core.settings import Settings
9+
from core.utils.device.adb import Adb
1010
from core.utils.device.device_manager import DeviceManager
1111
from core.utils.file_utils import Folder
12+
from data.const import Colors
1213
from data.templates import Template
1314
from products.nativescript.app import App
1415
from products.nativescript.tns import Tns
15-
from utils.device.adb import Adb
1616

1717

1818
# noinspection PyUnusedLocal

0 commit comments

Comments
 (0)