Ejemplo n.º 1
0
    def test_destroy_secgroup(self):
        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user", return_value=self.fake_client))
        fake_secgroup = {"id": self.fake_object["id"]}
        self.useFixture(mockpatch.PatchObject(javelin, "_get_resource_by_name", return_value=fake_secgroup))

        javelin.destroy_secgroups([self.fake_object])

        mocked_function = self.fake_client.secgroups.delete_security_group
        mocked_function.assert_called_once_with(self.fake_object["id"])
Ejemplo n.º 2
0
    def test_destroy_secgroup(self):
        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
                                              return_value=self.fake_client))
        fake_secgroup = {'id': self.fake_object['id']}
        self.useFixture(mockpatch.PatchObject(javelin, "_get_resource_by_name",
                                              return_value=fake_secgroup))

        javelin.destroy_secgroups([self.fake_object])

        mocked_function = self.fake_client.secgroups.delete_security_group
        mocked_function.assert_called_once_with(self.fake_object['id'])