Exemplo n.º 1
0
    def test_create_secgroup(self):
        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user", return_value=self.fake_client))
        self.fake_client.secgroups.list_security_groups.return_value = []
        self.fake_client.secgroups.create_security_group.return_value = {"id": self.fake_object["secgroup_id"]}

        javelin.create_secgroups([self.fake_object])

        mocked_function = self.fake_client.secgroups.create_security_group
        mocked_function.assert_called_once_with(
            name=self.fake_object["name"], description=self.fake_object["description"]
        )
Exemplo n.º 2
0
    def test_create_secgroup(self):
        self.useFixture(mockpatch.PatchObject(javelin, "client_for_user",
                                              return_value=self.fake_client))
        self.fake_client.secgroups.list_security_groups.return_value = []
        self.fake_client.secgroups.create_security_group.return_value = \
            {'id': self.fake_object['secgroup_id']}

        javelin.create_secgroups([self.fake_object])

        mocked_function = self.fake_client.secgroups.create_security_group
        mocked_function.assert_called_once_with(
            self.fake_object['name'],
            self.fake_object['description'])
Exemplo n.º 3
0
    def test_create_secgroup(self):
        self.useFixture(
            mockpatch.PatchObject(javelin,
                                  "client_for_user",
                                  return_value=self.fake_client))
        self.fake_client.secgroups.list_security_groups.return_value = []
        self.fake_client.secgroups.create_security_group.return_value = \
            {'id': self.fake_object['secgroup_id']}

        javelin.create_secgroups([self.fake_object])

        mocked_function = self.fake_client.secgroups.create_security_group
        mocked_function.assert_called_once_with(
            self.fake_object['name'], self.fake_object['description'])