本文整理匯總了Python中ariane_clip3.mapping.Node.del_twin_node方法的典型用法代碼示例。如果您正苦於以下問題:Python Node.del_twin_node方法的具體用法?Python Node.del_twin_node怎麽用?Python Node.del_twin_node使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ariane_clip3.mapping.Node
的用法示例。
在下文中一共展示了Node.del_twin_node方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_twin_nodes_link
# 需要導入模塊: from ariane_clip3.mapping import Node [as 別名]
# 或者: from ariane_clip3.mapping.Node import del_twin_node [as 別名]
def test_twin_nodes_link(self):
container2 = Container(name="test_twin_nodes_link_container2",
gate_uri="ssh://my_host/docker/test_twin_nodes_link_container2",
primary_admin_gate_name="container name space (pid)", company="Docker",
product="Docker", c_type="container")
node_mysql1 = Node(name="mysqld1", container=self.container1)
node_mysql2 = Node(name="mysqld2", container=container2)
node_mysql1.add_twin_node(node_mysql2, sync=False)
self.assertTrue(node_mysql2 in node_mysql1.twin_nodes_2_add)
node_mysql1.save()
self.assertFalse(node_mysql2 in node_mysql1.twin_nodes_2_add)
self.assertTrue(node_mysql2.id in node_mysql1.twin_nodes_id)
self.assertTrue(node_mysql1.id in node_mysql2.twin_nodes_id)
node_mysql2.del_twin_node(node_mysql1, sync=False)
self.assertTrue(node_mysql1 in node_mysql2.twin_nodes_2_rm)
self.assertTrue(node_mysql2.id in node_mysql1.twin_nodes_id)
self.assertTrue(node_mysql1.id in node_mysql2.twin_nodes_id)
node_mysql2.save()
self.assertFalse(node_mysql1 in node_mysql2.twin_nodes_2_rm)
self.assertFalse(node_mysql2.id in node_mysql1.twin_nodes_id)
self.assertFalse(node_mysql1.id in node_mysql2.twin_nodes_id)
node_mysql1.add_twin_node(node_mysql2)
self.assertTrue(node_mysql2.id in node_mysql1.twin_nodes_id)
self.assertTrue(node_mysql1.id in node_mysql2.twin_nodes_id)
node_mysql2.del_twin_node(node_mysql1)
self.assertFalse(node_mysql2.id in node_mysql1.twin_nodes_id)
self.assertFalse(node_mysql1.id in node_mysql2.twin_nodes_id)
node_mysql1.remove()
node_mysql2.remove()
container2.remove()