File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 3
3
from dotenv import load_dotenv
4
4
5
5
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
7
7
8
8
9
9
class EnvTestCase (unittest .TestCase ):
@@ -19,13 +19,21 @@ def test_env_cannot_overwrite(self):
19
19
domain = os .getenv ("domain" )
20
20
21
21
self .assertEqual (domain , "example.org" )
22
+
22
23
def test_user (self ):
23
24
if os .environ .get ("CI" ) == "true" :
24
25
if is_mac ():
25
26
self .assertEqual ('runner' , USER )
26
27
self .assertEqual ('root' , os .getlogin ())
27
28
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 )
29
37
elif is_windows ():
30
38
self .assertEqual (USER , os .getlogin ())
31
39
else :
@@ -38,7 +46,6 @@ def test_env_list_all(self):
38
46
39
47
class SystemTestCase (unittest .TestCase ):
40
48
def test_ls (self ):
41
-
42
49
import subprocess
43
50
44
51
subprocess .run (["ls" ])
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def test_bearer(self):
37
37
assert response ['authenticated' ] == True
38
38
assert response ['token' ] == token
39
39
40
- def test_get_with_load (self ):
40
+ def test_get_with_query_params (self ):
41
41
url = http_bin + 'get'
42
42
request = Request ()
43
43
payload = {'things' : 2 , 'total' : 25 }
You can’t perform that action at this time.
0 commit comments