Skip to content

Commit

Permalink
Merge "remove unneeded teardown related code"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Apr 7, 2015
2 parents bf70df2 + b749bca commit 0f70e10
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions nova/tests/unit/db/test_db_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7654,13 +7654,8 @@ def setUp(self):
self.engine, "shadow_instances")

self.uuidstrs = []
for unused in range(6):
for _ in range(6):
self.uuidstrs.append(stdlib_uuid.uuid4().hex)
self.ids = []
self.id_tablenames_to_cleanup = set(["console_pools", "consoles"])
self.uuid_tablenames_to_cleanup = set(["instance_id_mappings",
"instances"])
self.domain_tablenames_to_cleanup = set(["dns_domains"])

def _assert_shadow_tables_empty_except(self, *exceptions):
"""Ensure shadow tables are empty
Expand Down Expand Up @@ -7756,9 +7751,7 @@ def test_archive_deleted_rows_for_every_uuid_table(self):
tablenames.append(model_class.__tablename__)
tablenames.sort()
for tablename in tablenames:
ret = self._test_archive_deleted_rows_for_one_uuid_table(tablename)
if ret == 0:
self.uuid_tablenames_to_cleanup.add(tablename)
self._test_archive_deleted_rows_for_one_uuid_table(tablename)

def _test_archive_deleted_rows_for_one_uuid_table(self, tablename):
""":returns: 0 on success, 1 if no uuid column, 2 if insert failed."""
Expand Down Expand Up @@ -7861,12 +7854,10 @@ def test_archive_deleted_rows_fk_constraint(self):
ins_stmt = self.console_pools.insert().values(deleted=1)
result = self.conn.execute(ins_stmt)
id1 = result.inserted_primary_key[0]
self.ids.append(id1)
ins_stmt = self.consoles.insert().values(deleted=1,
pool_id=id1)
result = self.conn.execute(ins_stmt)
id2 = result.inserted_primary_key[0]
self.ids.append(id2)
result.inserted_primary_key[0]
# The first try to archive console_pools should fail, due to FK.
num = db.archive_deleted_rows_for_table(self.context, "console_pools")
self.assertEqual(num, 0)
Expand Down

0 comments on commit 0f70e10

Please sign in to comment.