Skip to content

Commit

Permalink
Merge pull request #47 from eduNEXT/mgs/fixtests
Browse files Browse the repository at this point in the history
Fix tests and update code to python3
  • Loading branch information
morenol authored Oct 14, 2020
2 parents dd6a8cf + 76445fb commit 4e275ef
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion flow_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Init for main Flow-Control XBlock
"""
from .flow import FlowCheckPointXblock
__version__ = '1.0.0'
__version__ = '1.0.1'
5 changes: 3 additions & 2 deletions flow_control/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pkg_resources
import re

from functools import reduce
from xblock.core import XBlock
from xblock.fragment import Fragment
from xblock.fields import Scope, Integer, String
Expand Down Expand Up @@ -394,7 +395,7 @@ def _calculate_total(first_score, second_score):
total = first_score['total'] + second_score['total']
return {'total': total}

usages_keys = map(_get_usage_key, problems)
usages_keys = list(map(_get_usage_key, problems))
scores_client.fetch_scores(usages_keys)
scores = map(scores_client.get, usages_keys)
scores = list(filter(None, scores))
Expand All @@ -407,7 +408,7 @@ def _calculate_total(first_score, second_score):

return evaluation

reducible_scores = map(_to_reducible, scores)
reducible_scores = list(map(_to_reducible, scores))
correct = reduce(_calculate_correct, reducible_scores,
correct_neutral)
total = reduce(_calculate_total, reducible_scores,
Expand Down
4 changes: 2 additions & 2 deletions flow_control/tests/test_flowcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_get_location_string(self, course_string):
self.block.course_id = MagicMock()
self.block.course_id.BLOCK_PREFIX = 'block-v1'
self.block.course_id.BLOCK_TYPE_PREFIX = 'type'
self.block.course_id.to_deprecated_string.return_value = course_string
self.block.course_id.__str__.return_value = course_string

course_replaced_url = course_string.replace(course_prefix, '', 1)
# execute code
Expand All @@ -129,7 +129,7 @@ def test_get_location_string(self, course_string):
)

self.assertEqual(testing_string, result_string)
self.block.course_id.to_deprecated_string.assert_called_with()
self.block.course_id.__str__.assert_called_with()

def test_get_condition_status(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.0
current_version = 1.0.1
commit = True
tag = True

Expand Down

0 comments on commit 4e275ef

Please sign in to comment.