Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1501 | fixing pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Jul 24, 2023
1 parent cc54e61 commit affa12b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions core/importers/input_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def fetch_file_from_url(self):
return requests.get(self.file_url, headers=headers, stream=True, timeout=30)
except Exception as e:
self.errors.append(f'Failed to download file from {self.file_url}, Exception: {e}.')
return None

def set_file_from_response(self, response):
if get(response, 'ok'):
Expand Down
2 changes: 1 addition & 1 deletion core/importers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ def json_result(self):
for key in total_result:
if result:
total_result[key] += result.get(key)
except:
except: # pylint: disable=bare-except
pass

total_result['start_time'] = self.start_time_formatted
Expand Down
9 changes: 3 additions & 6 deletions core/importers/tests.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import io
import json
import os
import uuid
from json import JSONDecodeError
from zipfile import ZipFile

from celery_once import AlreadyQueued
from django.core.files.uploadedfile import SimpleUploadedFile, InMemoryUploadedFile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.management import call_command
from django.db.models import F
from mock import patch, Mock, ANY, call, PropertyMock
Expand Down Expand Up @@ -1705,8 +1704,8 @@ def test_parse_csv_file(self):
'owner': 'DemoOrg',
'owner_type': 'Organization',
'source': 'MyDemoSource',
'from_concept_url': '/orgs/DemoOrg/sources/MyDemoSource/concepts//orgs/DemoOrg/sources/MyDemoSource/concepts/Child_of_child//',
'to_concept_url': '/orgs/DemoOrg/sources/MyDemoSource/concepts//orgs/DemoOrg/sources/MyDemoSource/concepts/Child//'
'from_concept_url': '/orgs/DemoOrg/sources/MyDemoSource/concepts//orgs/DemoOrg/sources/MyDemoSource/concepts/Child_of_child//', # pylint: disable=line-too-long
'to_concept_url': '/orgs/DemoOrg/sources/MyDemoSource/concepts//orgs/DemoOrg/sources/MyDemoSource/concepts/Child//' # pylint: disable=line-too-long
}, {
'type': 'Mapping',
'map_type': 'Parent-child',
Expand Down Expand Up @@ -1761,5 +1760,3 @@ def test_parse_zip_file_url(self, requests_get_mock, zipfile_mock):
self.assertEqual(parser1.content, parser.content)
requests_get_mock.assert_called_once_with(
'https://file.zip', headers={'User-Agent': 'OCL'}, stream=True, timeout=30)


0 comments on commit affa12b

Please sign in to comment.