Skip to content

Commit 7b88ba6

Browse files
aidaphalvarolopez
authored andcommitted
style: fix some flake8 style errors
1 parent d39f0cc commit 7b88ba6

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

caso/extract/openstack/cinder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def _build_record(self, volume, extract_from, extract_to):
5454
vol_created = extract_from
5555

5656
active_duration_delta = (extract_to - vol_created)
57-
active_duration = (extract_to - vol_created - datetime.timedelta(microseconds=active_duration_delta.microseconds)).total_seconds()
57+
ms = active_duration_delta.microseconds
58+
td = datetime.timedelta(microseconds=ms)
59+
active_duration = (active_duration_delta - td).total_seconds()
5860

5961
r = record.StorageRecord(
6062
uuid=volume.id,

caso/tests/extract/test_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
from unittest import mock
2626

2727
from caso.extract import manager
28-
from caso.tests import base
2928

3029
CONF = cfg.CONF
3130

31+
3232
class TestCasoManager(unittest.TestCase):
3333
"""Test case for the cASO extractor manager."""
3434

@@ -66,7 +66,6 @@ def test_extract_empty_projects(self):
6666
self.assertFalse(self.m_extractor.extract.called)
6767
self.assertEqual(ret, [])
6868

69-
7069
def test_extract(self):
7170
"""Test that we extract records for a given project."""
7271
self.flags(dry_run=True)

caso/tests/extract/test_nova.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
"""Tests for the OpenStack nova extractor."""
1616

1717
from caso.extract.openstack import nova
18-
from caso.extract import manager
19-
from caso.tests import base
2018

2119
import unittest
2220

21+
2322
class TestCasoManager(unittest.TestCase):
2423
"""Test case for Nova extractor."""
2524

caso/tests/test_manager.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414

1515
"""Tests for `caso.manager` module."""
1616

17-
from unittest.mock import patch
1817
from oslo_concurrency.fixture import lockutils as lock_fixture
1918
import six
2019
import unittest
2120
from unittest import mock
2221

2322
from caso import manager
24-
from caso.tests import base
2523

2624

2725
class TestCasoManager(unittest.TestCase):
@@ -48,4 +46,3 @@ def tearDown(self):
4846
p.stop()
4947

5048
super(TestCasoManager, self).tearDown()
51-

0 commit comments

Comments
 (0)