def test_factory_ssh():
    lock = Mock()
    switch = brocade_factory_ssh(SwitchDescriptor(hostname='hostname', model='brocade', username='******', password='******', port=22), lock)

    assert_that(switch, instance_of(FlowControlSwitch))
    assert_that(switch.wrapped_switch, instance_of(Brocade))
    assert_that(switch.lock, is_(lock))
    assert_that(switch.switch_descriptor.hostname, equal_to("hostname"))
    assert_that(switch.switch_descriptor.model, equal_to("brocade"))
    assert_that(switch.switch_descriptor.username, equal_to("username"))
    assert_that(switch.switch_descriptor.password, equal_to("password"))
    assert_that(switch.switch_descriptor.port, equal_to(22))
def test_factory_ssh():
    lock = Mock()
    switch = brocade_factory_ssh(
        SwitchDescriptor(hostname='hostname',
                         model='brocade',
                         username='******',
                         password='******',
                         port=22), lock)

    assert_that(switch, instance_of(FlowControlSwitch))
    assert_that(switch.wrapped_switch, instance_of(Brocade))
    assert_that(switch.lock, is_(lock))
    assert_that(switch.switch_descriptor.hostname, equal_to("hostname"))
    assert_that(switch.switch_descriptor.model, equal_to("brocade"))
    assert_that(switch.switch_descriptor.username, equal_to("username"))
    assert_that(switch.switch_descriptor.password, equal_to("password"))
    assert_that(switch.switch_descriptor.port, equal_to(22))
 def setUp(self):
     self.lock = mock.Mock()
     self.switch = brocade_factory_ssh(SwitchDescriptor(model='brocade', hostname="my.hostname"), self.lock)
     SubShell.debug = True