'When doing ``update_node()``, if the given ``Node`` has hostname in
existing ``Deployment`` node then replace that ``Node`` in the new
``Deployment``.'

def test_update_node_replace(self):

    node = Node(hostname=u'node1.example.com', applications={u'postgresql-clusterhq': Application(name=u'postgresql-clusterhq', image=DockerImage.from_string(u'image'))})
    another_node = Node(hostname=u'node2.example.com', applications={u'site-clusterhq.com': Application(name=u'site-clusterhq.com', image=DockerImage.from_string(u'image'))})
    updated_node = Node(hostname=u'node1.example.com', applications={})
    original = Deployment(nodes=frozenset([node, another_node]))
    updated = original.update_node(updated_node)
    self.assertEqual((original, updated), (Deployment(nodes=frozenset([node, another_node])), Deployment(nodes=frozenset([updated_node, another_node]))))
