Skip to content

Commit ecdd3ee

Browse files
author
jparisu
committed
TMP test windows system test
Signed-off-by: jparisu <[email protected]>
1 parent d2dfde8 commit ecdd3ee

File tree

1 file changed

+40
-18
lines changed

1 file changed

+40
-18
lines changed

py_utils/test/py_utils/unittest/system/test_System.py

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,51 @@
2121
from py_utils.system.system_utils import is_linux, is_windows
2222

2323

24+
def test_is_test():
25+
assert True
26+
27+
2428
def test_is_linux():
25-
# Test case 1: Running the script on a Linux system
26-
os.name = 'posix'
27-
assert is_linux()
2829

29-
# Test case 2: Running the script on a Windows system
30-
os.name = 'nt'
31-
assert not is_linux()
30+
# Test case 0: Running the script in its own system
31+
# NOTE: this could use same method as the function internally, but it is what it is.
32+
if os.name == 'posix':
33+
assert is_linux()
34+
35+
if os.name == 'nt':
36+
assert not is_linux()
37+
38+
# # Test case 1: Running the script on a Linux system
39+
# os.name = 'posix'
40+
# assert is_linux()
3241

33-
# Test case 3: Running the script on a different operating system
34-
os.name = 'mac'
35-
assert not is_linux()
42+
# # Test case 2: Running the script on a Windows system
43+
# os.name = 'nt'
44+
# assert not is_linux()
45+
46+
# # Test case 3: Running the script on a different operating system
47+
# os.name = 'mac'
48+
# assert not is_linux()
3649

3750

3851
def test_is_windows():
39-
# Test case 1: Running the script on a Linux system
40-
os.name = 'posix'
41-
assert not is_windows()
4252

43-
# Test case 2: Running the script on a Windows system
44-
os.name = 'nt'
45-
assert is_windows()
53+
# Test case 0: Running the script in its own system
54+
# NOTE: this could use same method as the function internally, but it is what it is.
55+
if os.name == 'posix':
56+
assert not is_windows()
57+
58+
if os.name == 'nt':
59+
assert is_windows()
60+
61+
# # Test case 1: Running the script on a Linux system
62+
# os.name = 'posix'
63+
# assert not is_windows()
64+
65+
# # Test case 2: Running the script on a Windows system
66+
# os.name = 'nt'
67+
# assert is_windows()
4668

47-
# Test case 3: Running the script on a different operating system
48-
os.name = 'mac'
49-
assert not is_windows()
69+
# # Test case 3: Running the script on a different operating system
70+
# os.name = 'mac'
71+
# assert not is_windows()

0 commit comments

Comments
 (0)