Skip to content

Commit

Permalink
Merge pull request #89 from edx-solutions/hasnain-naveed/YONK-1920
Browse files Browse the repository at this point in the history
YONK-1920 | Merging the rebase-juniper into the master.
  • Loading branch information
hasnain-naveed authored Mar 4, 2021
2 parents 1e03a05 + 6f9d53c commit adc0e90
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 26 deletions.
10 changes: 2 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
test:
docker:
- image: circleci/python:2.7.16-browsers
- image: circleci/python:3.5-browsers
steps:
- checkout
- run:
Expand All @@ -26,7 +26,7 @@ jobs:
when: always
quality:
docker:
- image: circleci/python:2.7.16
- image: circleci/python:3.5
steps:
- checkout
- run:
Expand All @@ -36,12 +36,6 @@ jobs:
virtualenv ./venv
. venv/bin/activate
pip install tox pylint
- run:
name: Run quality tests
command: |
. venv/bin/activate
tox -e quality
when: always
- run:
name: Run python3 quality tests
command: |
Expand Down
2 changes: 1 addition & 1 deletion image_explorer/image_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def _inner_content(self, tag, absolute_urls=False):
Helper met
"""
if tag is not None:
tag_content = u''.join(html.tostring(e) for e in tag)
tag_content = ''.join([ html.tostring(e, encoding=str) for e in tag ])
if absolute_urls:
return self._change_relative_url_to_absolute(tag_content)
return tag_content
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-e .
-e git+https://github.com/edx/xblock-utils.git@v1.1.0#egg=xblock-utils==1.1.0
edx-i18n-tools==0.4.7
lxml==3.0.1
mako==1.0.7
parsel==1.2.0
transifex-client==0.13.4
-e git+https://github.com/edx/xblock-utils.git@2.1.1#egg=xblock-utils==2.1.1
edx-i18n-tools==0.5.3
lxml==4.5.2
mako==1.1.3
parsel==1.6.0
transifex-client==0.13.11
2 changes: 1 addition & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from django.conf import settings
settings.INSTALLED_APPS += ("image_explorer", )

for noisy_logger, log_level in logging_level_overrides.iteritems():
for noisy_logger, log_level in logging_level_overrides.items():
logging.getLogger(noisy_logger).setLevel(log_level)

from django.core.management import execute_from_command_line
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ def package_data(pkg, root_list):

setup(
name='xblock-image-explorer',
version='1.2',
version='2.0',
description='XBlock - Image Explorer',
packages=['image_explorer'],
install_requires=[
'XBlock>=1.2',
'parsel>=1.6.0,<=1.6.0',
],
entry_points={
'xblock.v1': 'image-explorer = image_explorer:ImageExplorerBlock',
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_image_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def hotspots(self, block):
for h in hotspots:
h.content = h.find_element_by_css_selector(".image-explorer-hotspot-reveal")
h.close_button = h.find_element_by_css_selector(".image-explorer-close-reveal")
h.is_clickable = types.MethodType(lambda s: s.is_displayed() and s.is_enabled(), h, type(h))
h.is_clickable = types.MethodType(lambda s: s.is_displayed() and s.is_enabled(), h)
return {h.get_attribute("data-item-id"): h for h in hotspots}

def decorate_block(self, block):
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_image_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_collect_video_elements(self):
image_explorer_block._collect_video_elements(hotspot_with_videos, feedback)

# check if feedback has video elements attached
self.assertTrue(feedback.has_key('youtube'))
self.assertTrue('youtube' in feedback)
self.assertEqual(feedback.youtube.video_id, 'dmoZXcuozFQ')
self.assertTrue(feedback.has_key('bcove'))
self.assertTrue('bcove' in feedback)
self.assertEqual(feedback.bcove.video_id, '1234')
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[tox]
envlist = unit,integration,quality,python3-quality
envlist = unit,integration,python3-quality

[testenv]
whitelist_externals =
make
commands_pre =
pip install -e 'git://github.com/edx/xblock-sdk.git@v0.1.7#egg=xblock-sdk==0.1.7'
pip install -e 'git://github.com/edx/xblock-sdk.git@0.2.2#egg=xblock-sdk==0.2.2'
make -C {envdir}/src/xblock-sdk/ install
pip install -r requirements.txt

# upgrade both bok-choy and selenium to avoid BrokenPromise Error
# caused due to deprecated chromeOptions issue
pip install selenium==3.141.0 bok-choy==1.1.1

[testenv:unit]
commands =
python run_tests.py tests/unit
Expand All @@ -18,10 +22,6 @@ passenv = *
commands =
python run_tests.py tests/integration

[testenv:quality]
commands =
pylint image_explorer

[testenv:python3-quality]
commands =
pylint --py3k image_explorer

0 comments on commit adc0e90

Please sign in to comment.