Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitef5493f

Browse files
Merge pull request#208 from dmitry-lipetsk/D20250311_001--alpine_mktemp
[remote_ops] A problem with mktemp on Alpine Linux is fixed
2 parentsddcaea0 +e47cded commitef5493f

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

‎testgres/operations/remote_ops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def mkdtemp(self, prefix=None):
316316
- prefix (str): The prefix of the temporary directory name.
317317
"""
318318
ifprefix:
319-
command= ["mktemp","-d","-t",prefix+"XXXXX"]
319+
command= ["mktemp","-d","-t",prefix+"XXXXXX"]
320320
else:
321321
command= ["mktemp","-d"]
322322

@@ -344,7 +344,7 @@ def mkstemp(self, prefix=None):
344344
- prefix (str): The prefix of the temporary directory name.
345345
"""
346346
ifprefix:
347-
command= ["mktemp","-t",prefix+"XXXXX"]
347+
command= ["mktemp","-t",prefix+"XXXXXX"]
348348
else:
349349
command= ["mktemp"]
350350

‎tests/test_local.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
importpytest
55
importre
66
importtempfile
7+
importlogging
78

89
from ..testgresimportExecUtilException
910
from ..testgresimportInvalidOperationException
@@ -18,6 +19,22 @@ class TestLocalOperations:
1819
defsetup(self):
1920
self.operations=LocalOperations()
2021

22+
deftest_mkdtemp__default(self):
23+
path=self.operations.mkdtemp()
24+
logging.info("Path is [{0}].".format(path))
25+
assertos.path.exists(path)
26+
os.rmdir(path)
27+
assertnotos.path.exists(path)
28+
29+
deftest_mkdtemp__custom(self):
30+
C_TEMPLATE="abcdef"
31+
path=self.operations.mkdtemp(C_TEMPLATE)
32+
logging.info("Path is [{0}].".format(path))
33+
assertos.path.exists(path)
34+
assertC_TEMPLATEinos.path.basename(path)
35+
os.rmdir(path)
36+
assertnotos.path.exists(path)
37+
2138
deftest_exec_command_success(self):
2239
"""
2340
Test exec_command for successful command execution.

‎tests/test_remote.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
importpytest
55
importre
66
importtempfile
7+
importlogging
78

89
from ..testgresimportExecUtilException
910
from ..testgresimportInvalidOperationException
@@ -110,6 +111,22 @@ def test_makedirs_failure(self):
110111
withpytest.raises(Exception):
111112
self.operations.makedirs(path)
112113

114+
deftest_mkdtemp__default(self):
115+
path=self.operations.mkdtemp()
116+
logging.info("Path is [{0}].".format(path))
117+
assertos.path.exists(path)
118+
os.rmdir(path)
119+
assertnotos.path.exists(path)
120+
121+
deftest_mkdtemp__custom(self):
122+
C_TEMPLATE="abcdef"
123+
path=self.operations.mkdtemp(C_TEMPLATE)
124+
logging.info("Path is [{0}].".format(path))
125+
assertos.path.exists(path)
126+
assertC_TEMPLATEinos.path.basename(path)
127+
os.rmdir(path)
128+
assertnotos.path.exists(path)
129+
113130
deftest_rmdirs(self):
114131
path=self.operations.mkdtemp()
115132
assertos.path.exists(path)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp