Remove unnecessary test case in vault editor (#80741)

* Remove test_real_path_symlink test case
* Check if we do not get `-` return when some value other `-` is passed

Fixes: #80444

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/80748/head
Abhijeet Kasurde 1 year ago committed by GitHub
parent 4b0d014d58
commit 7ef8e0e102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -498,21 +498,9 @@ class TestVaultEditor(unittest.TestCase):
res = ve._real_path(filename)
self.assertEqual(res, '-')
def test_real_path_dev_null(self):
def test_real_path_not_dash(self):
filename = '/dev/null'
ve = self._vault_editor()
res = ve._real_path(filename)
self.assertEqual(res, '/dev/null')
def test_real_path_symlink(self):
self._test_dir = os.path.realpath(self._create_test_dir())
file_path = self._create_file(self._test_dir, 'test_file', content=b'this is a test file')
file_link_path = os.path.join(self._test_dir, 'a_link_to_test_file')
os.symlink(file_path, file_link_path)
ve = self._vault_editor()
res = ve._real_path(file_link_path)
self.assertEqual(res, file_path)
self.assertNotEqual(res, '-')

Loading…
Cancel
Save