forked from ceph/teuthology
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ceph#1806 from ceph/fix-pytest
tests: Fix warnings, deprecations, and broken tests
- Loading branch information
Showing
61 changed files
with
219 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,10 @@ | |
|
||
class TestRemote(object): | ||
|
||
def setup(self): | ||
def setup_method(self): | ||
self.start_patchers() | ||
|
||
def teardown(self): | ||
def teardown_method(self): | ||
self.stop_patchers() | ||
|
||
def start_patchers(self): | ||
|
@@ -60,8 +60,9 @@ def test_run(self): | |
rem = remote.Remote(name='[email protected]', ssh=self.m_ssh) | ||
rem._runner = m_run | ||
result = rem.run(args=args) | ||
assert m_transport.getpeername.called_once_with() | ||
assert m_run.called_once_with(args=args) | ||
m_transport.getpeername.assert_called_once_with() | ||
m_run_call_kwargs = m_run.call_args_list[0][1] | ||
assert m_run_call_kwargs['args'] == args | ||
assert result is proc | ||
assert result.remote is rem | ||
|
||
|
@@ -101,7 +102,7 @@ def test_arch(self): | |
stdout.seek(0) | ||
proc = RemoteProcess( | ||
client=self.m_ssh, | ||
args='fakey', | ||
args=args, | ||
) | ||
proc._stdout_buf = Mock() | ||
proc._stdout_buf.channel = Mock() | ||
|
@@ -111,15 +112,12 @@ def test_arch(self): | |
m_run.return_value = proc | ||
r = remote.Remote(name='[email protected]', ssh=self.m_ssh) | ||
r._runner = m_run | ||
assert m_transport.getpeername.called_once_with() | ||
assert proc._stdout_buf.channel.recv_exit_status.called_once_with() | ||
assert m_run.called_once_with( | ||
client=self.m_ssh, | ||
args=args, | ||
stdout=BytesIO(), | ||
name=r.shortname, | ||
) | ||
assert r.arch == 'test_arch' | ||
assert len(m_run.call_args_list) == 1 | ||
m_run_call_kwargs = m_run.call_args_list[0][1] | ||
assert m_run_call_kwargs['client'] == self.m_ssh | ||
assert m_run_call_kwargs['name'] == r.shortname | ||
assert m_run_call_kwargs['args'] == ' '.join(args) | ||
|
||
def test_host_key(self): | ||
m_key = MagicMock() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.