Пример #1
0
def test_simple():
    """ dev: create Device
    """
    # execute
    sut = dev.Device()
    # assert
    nt.ok_(sut, "should have an object of dev.Device")
Пример #2
0
def test_no_conn():
    """ dev: let all connections fail
    """
    # prepare
    test_input = "no connection will succeed here"
    expected_out = test_input
    sut = dev.Device(DefectiveConn(), DefectiveConn())
    # execute
    out = sut.cmd(test_input)
Пример #3
0
def test_send_cmd():
    """ dev: send cmd to EchoConnection
    """
    # prepare
    test_input = "just some text"
    expected_out = test_input
    sut = dev.Device(EchoConn())
    # execute
    out = sut.cmd(test_input)
    # assert
    nt.eq_(expected_out, out)
Пример #4
0
 def parse_device(self, name, sectype, section):
     section["name"] = name
     return md.Device(**section)