def tearDown(self): if self.created: for k, v in self.created.items(): user_info_list = [user[1] for user in v] account_id = k[1] o_account_url, d_account_url = ( self.create_st_account_url(account_id)) # Remove account content on origin and destination self.delete_account_cont(o_account_url, self.o_admin_token) self.delete_account_cont(d_account_url, self.d_admin_token) # We just need to delete keystone accounts and users # in origin keystone as syncer does not sync # keystone database filler.delete_account(self.o_ks_client, user_info_list, k)
def test_delete_account(self): self.delete_t_cnt = 0 self.delete_u_cnt = 0 def delete_t(*args): self.delete_t_cnt += 1 def delete_u(*args): self.delete_u_cnt += 1 client = FakeKSClient() client.tenants.delete = delete_t client.users.delete = delete_u filler.delete_account(client, [ FakeKSUser().id, ], ('account1', 'account1_id')) self.assertEqual(self.delete_t_cnt, 1) self.assertEqual(self.delete_u_cnt, 1)
def test_delete_account(self): self.delete_t_cnt = 0 self.delete_u_cnt = 0 def delete_t(*args): self.delete_t_cnt += 1 def delete_u(*args): self.delete_u_cnt += 1 client = FakeKSClient() client.tenants.delete = delete_t client.users.delete = delete_u filler.delete_account(client, [FakeKSUser().id, ], ('account1', 'account1_id')) self.assertEqual(self.delete_t_cnt, 1) self.assertEqual(self.delete_u_cnt, 1)