Skip to content

Instantly share code, notes, and snippets.

@baijum
Created July 11, 2011 16:38
Show Gist options
  • Select an option

  • Save baijum/1076238 to your computer and use it in GitHub Desktop.

Select an option

Save baijum/1076238 to your computer and use it in GitHub Desktop.

Revisions

  1. baijum revised this gist Jul 12, 2011. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions doubles.rst
    Original file line number Diff line number Diff line change
    @@ -11,3 +11,4 @@
    - http://labix.org/mocker
    - http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html
    - http://xunitpatterns.com/Test%20Spy.html
    - http://www.reddit.com/r/Python/comments/im32m/pythons_assert_is_good_enough_for_testing_can_we/
  2. baijum revised this gist Jul 11, 2011. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions doubles.rst
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    - http://stackoverflow.com/questions/463278/what-is-a-stub
    - http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy#MockTestingTools
    - http://pypi.python.org/pypi/MiniMock
    - http://www.voidspace.org.uk/python/mock/compare.html
  3. baijum revised this gist Jul 11, 2011. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions doubles.rst
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy#MockTestingTools
    http://pypi.python.org/pypi/MiniMock
    http://www.voidspace.org.uk/python/mock/compare.html
    http://garybernhardt.github.com/python-mock-comparison/
    http://c2.com/cgi/wiki?MockStubShunt
    http://c2.com/cgi/wiki?MockObject
    http://pypi.python.org/pypi/mock
    http://c2.com/cgi/wiki?LawOfDemeter
    http://martinfowler.com/articles/mocksArentStubs.html
    http://labix.org/mocker
    http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html
    http://xunitpatterns.com/Test%20Spy.html
    - http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy#MockTestingTools
    - http://pypi.python.org/pypi/MiniMock
    - http://www.voidspace.org.uk/python/mock/compare.html
    - http://garybernhardt.github.com/python-mock-comparison/
    - http://c2.com/cgi/wiki?MockStubShunt
    - http://c2.com/cgi/wiki?MockObject
    - http://pypi.python.org/pypi/mock
    - http://c2.com/cgi/wiki?LawOfDemeter
    - http://martinfowler.com/articles/mocksArentStubs.html
    - http://labix.org/mocker
    - http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html
    - http://xunitpatterns.com/Test%20Spy.html
  4. baijum revised this gist Jul 11, 2011. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions example_problem.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    import paramiko

    def do_some_action():
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.WarningPolicy())
    ssh.connect('localhost', username='guest', password='guest')
    chan = ssh.get_transport().open_session()
    chan.exec_command('/tmp/run.sh')
    status = chan.recv_exit_status()
    ssh.close()
    return status
  5. baijum revised this gist Jul 11, 2011. 2 changed files with 12 additions and 11 deletions.
    12 changes: 12 additions & 0 deletions doubles.rst
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy#MockTestingTools
    http://pypi.python.org/pypi/MiniMock
    http://www.voidspace.org.uk/python/mock/compare.html
    http://garybernhardt.github.com/python-mock-comparison/
    http://c2.com/cgi/wiki?MockStubShunt
    http://c2.com/cgi/wiki?MockObject
    http://pypi.python.org/pypi/mock
    http://c2.com/cgi/wiki?LawOfDemeter
    http://martinfowler.com/articles/mocksArentStubs.html
    http://labix.org/mocker
    http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html
    http://xunitpatterns.com/Test%20Spy.html
    11 changes: 0 additions & 11 deletions paramiko_example.py
    Original file line number Diff line number Diff line change
    @@ -1,11 +0,0 @@
    import paramiko

    def do_some_action():
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.WarningPolicy())
    ssh.connect('localhost', username='guest', password='guest')
    chan = ssh.get_transport().open_session()
    chan.exec_command('/tmp/run.sh')
    status = chan.recv_exit_status()
    ssh.close()
    return status
  6. baijum revised this gist Jul 11, 2011. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion paramiko_example.py
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    import paramiko

    def do_some_action():
    import paramiko
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.WarningPolicy())
    ssh.connect('localhost', username='guest', password='guest')
  7. baijum revised this gist Jul 11, 2011. 1 changed file with 10 additions and 9 deletions.
    19 changes: 10 additions & 9 deletions paramiko_example.py
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,10 @@
    import paramiko
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.WarningPolicy())
    ssh.connect('localhost', username='guest', password='guest')
    chan = ssh.get_transport().open_session()
    chan.exec_command('/tmp/run.sh')
    status = chan.recv_exit_status()
    ssh.close()
    return status
    def do_some_action():
    import paramiko
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.WarningPolicy())
    ssh.connect('localhost', username='guest', password='guest')
    chan = ssh.get_transport().open_session()
    chan.exec_command('/tmp/run.sh')
    status = chan.recv_exit_status()
    ssh.close()
    return status
  8. baijum created this gist Jul 11, 2011.
    9 changes: 9 additions & 0 deletions paramiko_example.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    import paramiko
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.WarningPolicy())
    ssh.connect('localhost', username='guest', password='guest')
    chan = ssh.get_transport().open_session()
    chan.exec_command('/tmp/run.sh')
    status = chan.recv_exit_status()
    ssh.close()
    return status