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

TestOsOpsCommon is added [generic os_ops tests]#231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
11 commits
Select commitHold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
TestOsOpsCommon is updated
New tests:- test_mkdtemp__default- test_mkdtemp__custom
  • Loading branch information
@dmitry-lipetsk
dmitry-lipetsk committedApr 2, 2025
commit5111f87095c28f5a249c5ec148032b5ac65f1e25
17 changes: 0 additions & 17 deletionstests/test_local.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,6 @@

import pytest
import re
import logging

from ..testgres import LocalOperations

Expand All@@ -14,22 +13,6 @@ class TestLocalOperations:
def setup(self):
self.operations = LocalOperations()

def test_mkdtemp__default(self):
path = self.operations.mkdtemp()
logging.info("Path is [{0}].".format(path))
assert os.path.exists(path)
os.rmdir(path)
assert not os.path.exists(path)

def test_mkdtemp__custom(self):
C_TEMPLATE = "abcdef"
path = self.operations.mkdtemp(C_TEMPLATE)
logging.info("Path is [{0}].".format(path))
assert os.path.exists(path)
assert C_TEMPLATE in os.path.basename(path)
os.rmdir(path)
assert not os.path.exists(path)

def test_read__unknown_file(self):
"""
Test LocalOperations::read with unknown file.
Expand Down
21 changes: 21 additions & 0 deletionstests/test_os_ops_common.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
import pytest
import re
import tempfile
import logging

from ..testgres import InvalidOperationException
from ..testgres import ExecUtilException
Expand DownExpand Up@@ -204,6 +205,26 @@ def test_path_exists_false__file(self, os_ops: OsOperations):

assert os_ops.path_exists("/etc/nonexistent_path.txt") is False

def test_mkdtemp__default(self, os_ops: OsOperations):
assert isinstance(os_ops, OsOperations)

path = os_ops.mkdtemp()
logging.info("Path is [{0}].".format(path))
assert os.path.exists(path)
os.rmdir(path)
assert not os.path.exists(path)

def test_mkdtemp__custom(self, os_ops: OsOperations):
assert isinstance(os_ops, OsOperations)

C_TEMPLATE = "abcdef"
path = os_ops.mkdtemp(C_TEMPLATE)
logging.info("Path is [{0}].".format(path))
assert os.path.exists(path)
assert C_TEMPLATE in os.path.basename(path)
os.rmdir(path)
assert not os.path.exists(path)

def test_write_text_file(self, os_ops: OsOperations):
"""
Test write for writing data to a text file.
Expand Down
17 changes: 0 additions & 17 deletionstests/test_remote.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,6 @@
import os

import pytest
import logging

from ..testgres import ExecUtilException
from ..testgres import RemoteOperations
Expand All@@ -18,22 +17,6 @@ def setup(self):
ssh_key=os.getenv('RDBMS_TESTPOOL_SSHKEY'))
self.operations = RemoteOperations(conn_params)

def test_mkdtemp__default(self):
path = self.operations.mkdtemp()
logging.info("Path is [{0}].".format(path))
assert os.path.exists(path)
os.rmdir(path)
assert not os.path.exists(path)

def test_mkdtemp__custom(self):
C_TEMPLATE = "abcdef"
path = self.operations.mkdtemp(C_TEMPLATE)
logging.info("Path is [{0}].".format(path))
assert os.path.exists(path)
assert C_TEMPLATE in os.path.basename(path)
os.rmdir(path)
assert not os.path.exists(path)

def test_rmdirs(self):
path = self.operations.mkdtemp()
assert os.path.exists(path)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp