Revision 8b2d63a7 kamaki/clients/cyclades/test.py

b/kamaki/clients/cyclades/test.py
545 545
        self.assertEqual(delete.mock_calls[-1], call(fip))
546 546

  
547 547
    @patch('%s.servers_post' % cyclades_pkg, return_value=FR())
548
    def test_assoc_floating_ip_to_server(self, spost):
548
    def test_attach_floating_ip(self, spost):
549 549
        vmid, addr = 42, 'anIpAddress'
550 550
        for err, args in {
551 551
                ValueError: ['not a server id', addr],
......
553 553
                AssertionError: [vmid, None],
554 554
                AssertionError: [vmid, '']}.items():
555 555
            self.assertRaises(
556
                err, self.client.assoc_floating_ip_to_server, *args)
557
        r = self.client.assoc_floating_ip_to_server(vmid, addr)
556
                err, self.client.attach_floating_ip, *args)
557
        r = self.client.attach_floating_ip(vmid, addr)
558 558
        self.assert_dicts_are_equal(r, FR.headers)
559 559
        expected = dict(addFloatingIp=dict(address=addr))
560 560
        self.assertEqual(
561 561
            spost.mock_calls[-1], call(vmid, 'action', json_data=expected))
562 562

  
563 563
    @patch('%s.servers_post' % cyclades_pkg, return_value=FR())
564
    def test_disassoc_floating_ip_to_server(self, spost):
564
    def test_detach_floating_ip(self, spost):
565 565
        vmid, addr = 42, 'anIpAddress'
566 566
        for err, args in {
567 567
                ValueError: ['not a server id', addr],
......
569 569
                AssertionError: [vmid, None],
570 570
                AssertionError: [vmid, '']}.items():
571 571
            self.assertRaises(
572
                err, self.client.disassoc_floating_ip_to_server, *args)
573
        r = self.client.disassoc_floating_ip_to_server(vmid, addr)
572
                err, self.client.detach_floating_ip, *args)
573
        r = self.client.detach_floating_ip(vmid, addr)
574 574
        self.assert_dicts_are_equal(r, FR.headers)
575 575
        expected = dict(removeFloatingIp=dict(address=addr))
576 576
        self.assertEqual(

Also available in: Unified diff