File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 77 reason = "OpenModelica Docker image is Linux-only; skipping on Windows." ,
88)
99
10+ skip_python_older_312 = pytest .mark .skipif (
11+ sys .version_info < (3 , 12 ),
12+ reason = "OMCPath only working for Python >= 3.12 (definition of pathlib.PurePath)." ,
13+ )
14+
1015
1116@skip_on_windows
17+ @skip_python_older_312
1218def test_OMCPath_docker ():
1319 omcp = OMPython .OMCProcessDocker (docker = "openmodelica/openmodelica:v1.25.0-minimal" )
1420 om = OMPython .OMCSessionZMQ (omc_process = omcp )
@@ -29,13 +35,19 @@ def test_OMCPath_docker():
2935 del om
3036
3137
38+ @skip_python_older_312
3239def test_OMCPath_local ():
3340 om = OMPython .OMCSessionZMQ ()
3441
35- p1 = om .omcpath ('/tmp' )
36- assert str (p1 ) == "/tmp"
42+ if sys .platform .startswith ("win" ):
43+ tempdir = 'C:/temp'
44+ else :
45+ tempdir = '/tmp'
46+
47+ p1 = om .omcpath (tempdir )
48+ assert str (p1 ) == tempdir
3749 p2 = p1 / 'test.txt'
38- assert str (p2 ) == "/tmp /test.txt"
50+ assert str (p2 ) == f" { tempdir } /test.txt"
3951 assert p2 .write_text ('test' )
4052 assert p2 .read_text () == "test"
4153 assert p2 .is_file ()
@@ -48,4 +60,5 @@ def test_OMCPath_local():
4860
4961if __name__ == '__main__' :
5062 test_OMCPath_docker ()
63+ test_OMCPath_local ()
5164 print ('DONE' )
You can’t perform that action at this time.
0 commit comments