|
|
@@ -72,6 +72,9 @@ def new_parse_socket_addr(domain, addr): |
|
|
|
|
|
|
|
tcp_server.parse_socket_addr = new_parse_socket_addr |
|
|
|
|
|
|
|
class SerialConsole(DefROAttribute): |
|
|
|
defattrname = 'console' |
|
|
|
|
|
|
|
class BoardImpl: |
|
|
|
def __init__(self, name, brdclass, options): |
|
|
|
self.name = name |
|
|
@@ -825,3 +828,13 @@ class TestBiteLab(unittest.IsolatedAsyncioTestCase): |
|
|
|
'attrs': { 'power': True }, |
|
|
|
} |
|
|
|
self.assertEqual(res.json(), info) |
|
|
|
|
|
|
|
class TestAttrs(unittest.IsolatedAsyncioTestCase): |
|
|
|
async def test_serialconsole(self): |
|
|
|
data = 'somepath' |
|
|
|
sc = SerialConsole(data) |
|
|
|
|
|
|
|
self.assertEqual(data, await sc.getvalue()) |
|
|
|
|
|
|
|
with self.assertRaises(TypeError): |
|
|
|
await sc.setvalue(data) |