示例#1
0
 def test_ls(self):
     """
     ls should call through to the plumber and return a dictionary ready
     for AMP
     """
     c = Server(FakePlumber({
         'ls': [
             ('foo', 'thing1', 0, True),
             ('bar', 'thing2', 1, False),
             ('bar', 'thing3', 12, True),
         ]
     }))
     r = c.ls()
     self.assertEqual(r['pipes'], [
         {
             'src': 'foo',
             'dst': 'thing1',
             'conns': 0,
             'active': True,
         },
         {
             'src': 'bar',
             'dst': 'thing2',
             'conns': 1,
             'active': False,
         },
         {
             'src': 'bar',
             'dst': 'thing3',
             'conns': 12,
             'active': True,
         },
     ])