Пример #1
0
 def test_connection_info(self):
     """
     Test connection_info action
     """
     zdb = Zerodb('zdb', data=self.valid_data)
     node = MagicMock( public_addr='127.0.0.1', storageAddr='127.0.0.1')
     zdb_sal = MagicMock(node_port=9000, node=node)
     zdb._node_sal.primitives.from_dict.return_value = zdb_sal
     assert zdb.connection_info() == {
         'ip': zdb_sal.node.public_addr,
         'port': zdb.data['nodePort'],
     }
Пример #2
0
 def test_connection_info(self):
     """
     Test connection_info action
     """
     zdb = Zerodb('zdb', data=self.valid_data)
     node_sal = MagicMock(public_addr='127.0.0.1')
     patch('js9.j.clients.zos.sal.get_node',
           MagicMock(return_value=node_sal)).start()
     assert zdb.connection_info() == {
         'ip': node_sal.public_addr,
         'port': zdb.data['nodePort'],
     }