ncouture / MockSSH

Mock an SSH server and define all commands it supports (Python, Twisted)
Other
123 stars 23 forks source link

Hack a threaded MockSSH Server #7

Closed claudyus closed 9 years ago

claudyus commented 9 years ago

This commit hacks the library allowing you to run a threaded version of the MockServer

Here and example in unittest that shutdown it appropriately:

class TestSSH(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        users = {'root': 'password'}
        MockSSH.threadedServer(commands,
                prompt="$",
                interface="localhost",
                port=9856,
                **users)

    @classmethod
    def tearDownClass(cls):
        MockSSH.threadedServerStop()
claudyus commented 9 years ago

I'm going to update this pull request with some unittest asap.