diff options
author | Stanislav Levin <slev@altlinux.org> | 2021-12-02 17:11:29 +0300 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2022-06-03 15:03:47 -0400 |
commit | 47cfed55575c21ac558e6d00a4ab1814406be651 (patch) | |
tree | 005457ae72e9709de7d8401dab8a17ca4e5bca76 /tests/test_sftp.py | |
parent | af664ad316b23592e9cec429c03d593d8cbd0ed6 (diff) |
sftp tests: Replace unittest parts
The original PR https://github.com/paramiko/paramiko/pull/992
introduced several tests for sftp functionality. These tests
made use of unittest's stuff like `assertTrue` and `assertEqual`
because at that moment the tests were grouped under the
`unittest.TestCase`-based class (`SFTPTest`). Before PR merge
`unittest.TestCase` was refactored out from sftp tests
(667bd74b139ed86f9b261d3abf5b6042ba80920b) but PR
was not updated. The sftp tests are marked with `slow` and that's
why they are not failed in CI (slow tests are excluded by default).
Fixes: https://github.com/paramiko/paramiko/issues/1941
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Diffstat (limited to 'tests/test_sftp.py')
-rw-r--r-- | tests/test_sftp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py index 6134d070..2152d885 100644 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -277,7 +277,7 @@ class TestSFTP(object): sftp.open(sftp.FOLDER + "/canard.txt", "w").close() try: folder_contents = sftp.listdir(sftp.FOLDER) - self.assertEqual(["canard.txt"], folder_contents) + assert ["canard.txt"] == folder_contents finally: sftp.remove(sftp.FOLDER + "/canard.txt") @@ -797,7 +797,7 @@ class TestSFTP(object): """Test SFTPAttributes under a locale with non-ascii time strings.""" some_stat = os.stat(sftp.FOLDER) sftp_attributes = SFTPAttributes.from_stat(some_stat, u("a_directory")) - self.assertTrue(b"a_directory" in sftp_attributes.asbytes()) + assert b"a_directory" in sftp_attributes.asbytes() def test_sftp_attributes_empty_str(self, sftp): sftp_attributes = SFTPAttributes() |