def test_simple(): """ dev: create Device """ # execute sut = dev.Device() # assert nt.ok_(sut, "should have an object of dev.Device")
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)
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)
def parse_device(self, name, sectype, section): section["name"] = name return md.Device(**section)