← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1264204] [NEW] redundant code in glance.tests.unit.utils:FakeDB.reset

 

Public bug reported:

glance.tests.unit.utils:FakeDB uses glance.db.simple.api

FakeDB  implements reset with:

    @staticmethod
    def reset():
        simple_db.DATA = {
            'images': {},
            'members': [],
            'tags': {},
            'locations': [],
            'tasks': {},
            'task_info': {}
        }

while api already has:

def reset():
    global DATA
    DATA = {
        'images': {},
        'members': [],
        'tags': {},
        'locations': [],
        'tasks': {},
        'task_info': {}
    }

the redundant code in glance.tests.unit.utils:FakeDB.reset should be
replaced with simple_db.reset()

** Affects: glance
     Importance: Undecided
     Assignee: ZhiQiang Fan (aji-zqfan)
         Status: New


** Tags: low-hanging-fruit unittest

** Changed in: glance
     Assignee: (unassigned) => ZhiQiang Fan (aji-zqfan)

** Tags added: low-hanging-fruit unittest

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1264204

Title:
  redundant code in glance.tests.unit.utils:FakeDB.reset

Status in OpenStack Image Registry and Delivery Service (Glance):
  New

Bug description:
  glance.tests.unit.utils:FakeDB uses glance.db.simple.api

  FakeDB  implements reset with:

      @staticmethod
      def reset():
          simple_db.DATA = {
              'images': {},
              'members': [],
              'tags': {},
              'locations': [],
              'tasks': {},
              'task_info': {}
          }

  while api already has:

  def reset():
      global DATA
      DATA = {
          'images': {},
          'members': [],
          'tags': {},
          'locations': [],
          'tasks': {},
          'task_info': {}
      }

  the redundant code in glance.tests.unit.utils:FakeDB.reset should be
  replaced with simple_db.reset()

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1264204/+subscriptions


Follow ups

References