Skip to content

Commit

Permalink
TMP test windows system test
Browse files Browse the repository at this point in the history
Signed-off-by: jparisu <[email protected]>
  • Loading branch information
jparisu committed Jun 20, 2023
1 parent d2dfde8 commit ecdd3ee
Showing 1 changed file with 40 additions and 18 deletions.
58 changes: 40 additions & 18 deletions py_utils/test/py_utils/unittest/system/test_System.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,51 @@
from py_utils.system.system_utils import is_linux, is_windows


def test_is_test():
assert True


def test_is_linux():
# Test case 1: Running the script on a Linux system
os.name = 'posix'
assert is_linux()

# Test case 2: Running the script on a Windows system
os.name = 'nt'
assert not is_linux()
# Test case 0: Running the script in its own system
# NOTE: this could use same method as the function internally, but it is what it is.
if os.name == 'posix':
assert is_linux()

if os.name == 'nt':
assert not is_linux()

# # Test case 1: Running the script on a Linux system
# os.name = 'posix'
# assert is_linux()

# Test case 3: Running the script on a different operating system
os.name = 'mac'
assert not is_linux()
# # Test case 2: Running the script on a Windows system
# os.name = 'nt'
# assert not is_linux()

# # Test case 3: Running the script on a different operating system
# os.name = 'mac'
# assert not is_linux()


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

# Test case 2: Running the script on a Windows system
os.name = 'nt'
assert is_windows()
# Test case 0: Running the script in its own system
# NOTE: this could use same method as the function internally, but it is what it is.
if os.name == 'posix':
assert not is_windows()

if os.name == 'nt':
assert is_windows()

# # Test case 1: Running the script on a Linux system
# os.name = 'posix'
# assert not is_windows()

# # Test case 2: Running the script on a Windows system
# os.name = 'nt'
# assert is_windows()

# Test case 3: Running the script on a different operating system
os.name = 'mac'
assert not is_windows()
# # Test case 3: Running the script on a different operating system
# os.name = 'mac'
# assert not is_windows()

0 comments on commit ecdd3ee

Please sign in to comment.