8000 TestOsOpsCommon is added [generic os_ops tests] by dmitry-lipetsk · Pull Request #231 · postgrespro/testgres · GitHub
[go: up one dir, main page]

Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev Previous commit
TestOsOpsCommon::test_touch is added
  • Loading branch information
dmitry-lipetsk committed Apr 2, 2025
commit 1716e7c37404780d369c72a895adac3e9391dd6c
16 changes: 16 additions & 0 deletions tests/test_os_ops_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,19 @@ def test_write(self, write_data001: tagWriteData001, os_ops: OsOperations):
s = tmp_file.read()

assert s == write_data001.result

def test_touch(self, os_ops: OsOperations):
"""
Test touch for creating a new file or updating access and modification times of an existing file.
"""
assert isinstance(os_ops, OsOperations)

filename = os_ops.mkstemp()

# TODO: this test does not check the result of 'touch' command!

os_ops.touch(filename)

assert os_ops.isfile(filename)

os_ops.remove_file(filename)
10 changes: 0 additions & 10 deletions tests/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,3 @@ def test_get_file_size__unk_file(self):
assert "Utility exited with non-zero code (1)." in str(x.value)
assert "No such file or directory" in str(x.value)
assert "/dummy" in str(x.value)

def test_touch(self):
"""
Test touch for creating a new file or updating access and modification times of an existing file.
"""
filename = "/tmp/test_file.txt"

self.operations.touch(filename)

assert self.operations.isfile(filename)
0