Commit f84fafed92e471a28cbbc1d2e32ea8811a1cb2ab

Authored by selurvedu
1 parent c6648759

Fix several warnings reported by Flake8

`E501 line too long` was not fixed because it is better
to fix this error in all files at once.
1 1 # -*- coding: utf-8 -
  2 +import os
  3 +import random
2 4 from datetime import timedelta
  5 +from tempfile import NamedTemporaryFile
  6 +from uuid import uuid4
3 7 from faker import Factory
4 8 from faker.providers.company.en_US import Provider as CompanyProviderEnUs
5 9 from faker.providers.company.ru_RU import Provider as CompanyProviderRuRu
6 10 from munch import munchify
7   -from uuid import uuid4
8   -from tempfile import NamedTemporaryFile
9   -from .local_time import get_now
10 11 from op_faker import OP_Provider
11   -import os
12   -import random
  12 +from .local_time import get_now
13 13
14 14
15 15 fake_en = Factory.create(locale='en_US')
... ... @@ -116,7 +116,7 @@ def test_tender_data(params, periods=("enquiry", "tender")):
116 116 if params.get('lot_meat'):
117 117 new_feature = test_feature_data()
118 118 new_feature['featureOf'] = "lot"
119   - data['lots'][0]['id'] = data['lots'][0].get('id', uuid4().hex)
  119 + data['lots'][0]['id'] = data['lots'][0].get('id', uuid4().hex)
120 120 new_feature['relatedItem'] = data['lots'][0]['id']
121 121 data['features'].append(new_feature)
122 122 else:
... ... @@ -130,7 +130,7 @@ def test_tender_data(params, periods=("enquiry", "tender")):
130 130 if params.get('item_meat'):
131 131 new_feature = test_feature_data()
132 132 new_feature['featureOf'] = "item"
133   - data['items'][0]['id'] = data['items'][0].get('id', uuid4().hex)
  133 + data['items'][0]['id'] = data['items'][0].get('id', uuid4().hex)
134 134 new_feature['relatedItem'] = data['items'][0]['id']
135 135 data['features'].append(new_feature)
136 136 if not data['features']:
... ... @@ -315,9 +315,9 @@ def test_item_data(cpv=None):
315 315 data["description_ru"] = field_with_id("i", data["description_ru"])
316 316 days = fake.random_int(min=1, max=30)
317 317 data["deliveryDate"] = {
318   - "startDate":(get_now() + timedelta(days=days)).isoformat(),
319   - "endDate":(get_now() + timedelta(days=days)).isoformat()
320   - }
  318 + "startDate": (get_now() + timedelta(days=days)).isoformat(),
  319 + "endDate": (get_now() + timedelta(days=days)).isoformat()
  320 + }
321 321 data["deliveryAddress"]["countryName_en"] = translate_country_en(data["deliveryAddress"]["countryName"])
322 322 data["deliveryAddress"]["countryName_ru"] = translate_country_ru(data["deliveryAddress"]["countryName"])
323 323 return munchify(data)
... ... @@ -371,7 +371,6 @@ def test_lot_document_data(document, lot_id):
371 371 return munchify(document)
372 372
373 373
374   -
375 374 def test_tender_data_openua(params):
376 375 # We should not provide any values for `enquiryPeriod` when creating
377 376 # an openUA or openEU procedure. That field should not be present at all.
... ...
... ... @@ -6,7 +6,6 @@ from datetime import timedelta
6 6 from dateutil.parser import parse
7 7 from dpath.util import new as xpathnew
8 8 from haversine import haversine
9   -from iso8601 import parse_date
10 9 from json import load, loads
11 10 from jsonpath_rw import parse as parse_path
12 11 from munch import Munch, munchify
... ...
Please register or login to post a comment