Skip to content

Commit 88e68ea

Browse files
committed
fix ci
1 parent c7e367c commit 88e68ea

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

tests/env_test.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from dotenv import load_dotenv
44

55
from davidkhala.syntax import is_mac, is_linux, is_windows
6-
from davidkhala.syntax.env import USER
6+
from davidkhala.syntax.env import USER, Version
77

88

99
class EnvTestCase(unittest.TestCase):
@@ -19,13 +19,21 @@ def test_env_cannot_overwrite(self):
1919
domain = os.getenv("domain")
2020

2121
self.assertEqual(domain, "example.org")
22+
2223
def test_user(self):
2324
if os.environ.get("CI") == "true":
2425
if is_mac():
2526
self.assertEqual('runner', USER)
2627
self.assertEqual('root', os.getlogin())
2728
elif is_linux():
28-
self.assertRaisesRegex(OSError,r"\[Errno 25\] Inappropriate ioctl for device", os.getlogin)
29+
version = Version()
30+
31+
match version.minor:
32+
case '10': # 3.10
33+
expectedError = r"[Errno 25] Inappropriate ioctl for device"
34+
case _: # default
35+
expectedError = r"[Errno -25] Unknown error -25"
36+
self.assertRaisesRegex(OSError, expectedError, os.getlogin)
2937
elif is_windows():
3038
self.assertEqual(USER, os.getlogin())
3139
else:
@@ -38,7 +46,6 @@ def test_env_list_all(self):
3846

3947
class SystemTestCase(unittest.TestCase):
4048
def test_ls(self):
41-
4249
import subprocess
4350

4451
subprocess.run(["ls"])

tests/http_request_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_bearer(self):
3737
assert response['authenticated'] == True
3838
assert response['token'] == token
3939

40-
def test_get_with_load(self):
40+
def test_get_with_query_params(self):
4141
url = http_bin + 'get'
4242
request = Request()
4343
payload = {'things': 2, 'total': 25}

0 commit comments

Comments
 (0)