예제 #1
0
    def test_bw_usage_get(self):
        self.mox.StubOutWithMock(db, "bw_usage_update")
        self.mox.StubOutWithMock(db, "bw_usage_get")

        get_args = (self.context, "uuid", 0, "mac")

        db.bw_usage_get(*get_args).AndReturn("foo")

        self.mox.ReplayAll()
        result = self.conductor.bw_usage_get(*get_args)
        self.assertEqual(result, "foo")
예제 #2
0
    def test_bw_usage_get(self):
        self.mox.StubOutWithMock(db, 'bw_usage_update')
        self.mox.StubOutWithMock(db, 'bw_usage_get')

        get_args = (self.context, 'uuid', 0, 'mac')

        db.bw_usage_get(*get_args).AndReturn('foo')

        self.mox.ReplayAll()
        result = self.conductor.bw_usage_get(*get_args)
        self.assertEqual(result, 'foo')
예제 #3
0
    def test_bw_usage_get(self):
        self.mox.StubOutWithMock(db, 'bw_usage_update')
        self.mox.StubOutWithMock(db, 'bw_usage_get')

        get_args = (self.context, 'uuid', 0, 'mac')

        db.bw_usage_get(*get_args).AndReturn('foo')

        self.mox.ReplayAll()
        result = self.conductor.bw_usage_get(*get_args)
        self.assertEqual(result, 'foo')
예제 #4
0
 def get_by_instance_uuid_and_mac(cls, context, instance_uuid, mac,
                                  start_period=None, use_slave=False):
     db_bw_usage = db.bw_usage_get(context, uuid=instance_uuid,
                                   start_period=start_period, mac=mac,
                                   use_slave=use_slave)
     if db_bw_usage:
         return cls._from_db_object(context, cls(), db_bw_usage)
예제 #5
0
 def _db_bw_usage_get(context, uuid, start_period, mac, use_slave=False):
     return db.bw_usage_get(context, uuid=uuid, start_period=start_period,
                            mac=mac)