Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_rename():
"""Test the rename call."""
old_filename = join(dirname(__file__), 'resources', 'test_file1.txt')
new_filename = join(dirname(__file__), 'resources', 'test_file2.txt')
yield from aiofiles.os.rename(old_filename, new_filename)
assert exists(old_filename) is False and exists(new_filename)
yield from aiofiles.os.rename(new_filename, old_filename)
assert exists(old_filename) and exists(new_filename) is False
def test_rename():
"""Test the rename call."""
old_filename = join(dirname(__file__), 'resources', 'test_file1.txt')
new_filename = join(dirname(__file__), 'resources', 'test_file2.txt')
yield from aiofiles.os.rename(old_filename, new_filename)
assert exists(old_filename) is False and exists(new_filename)
yield from aiofiles.os.rename(new_filename, old_filename)
assert exists(old_filename) and exists(new_filename) is False