File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import OMPython
22
33
4+ @pytest .mark .skip (reason = "This test would fail (no docker on github)" )
45def test_OMCPath_docker ():
56 omcp = OMPython .OMCProcessDocker (docker = "openmodelica/openmodelica:v1.25.0-minimal" )
67 om = OMPython .OMCSessionZMQ (omc_process = omcp )
@@ -21,6 +22,24 @@ def test_OMCPath_docker():
2122 del om
2223
2324
25+ def test_OMCPath_local ():
26+ om = OMPython .OMCSessionZMQ ()
27+
28+ p1 = om .omcpath ('/tmp' )
29+ assert str (p1 ) == "/tmp"
30+ p2 = p1 / 'test.txt'
31+ assert str (p2 ) == "/tmp/test.txt"
32+ assert p2 .write_text ('test' )
33+ assert p2 .read_text () == "test"
34+ assert p2 .is_file ()
35+ assert p2 .parent .is_dir ()
36+ assert p2 .unlink ()
37+ assert p2 .is_file () is False
38+
39+ del omcp
40+ del om
41+
42+
2443if __name__ == '__main__' :
2544 test_OMCPath_docker ()
2645 print ('DONE' )
You can’t perform that action at this time.
0 commit comments