Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #32 from mitodl/feature/remove_local_version_check
Browse files Browse the repository at this point in the history
Remove test for local version matching
  • Loading branch information
pdpinch committed Mar 27, 2015
2 parents 9fa0796 + 44d7030 commit 2add6b4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
9 changes: 0 additions & 9 deletions pylmod/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
PyLmod is a module that implements MIT Learning Modules API in Python
"""
import os.path
from pkg_resources import get_distribution, DistributionNotFound

from pylmod.gradebook import GradeBook
Expand All @@ -13,14 +12,6 @@ def _get_version():
# pylint: disable=no-member
try:
dist = get_distribution(__project__)
# Normalize case for Windows systems
dist_loc = os.path.normcase(dist.location)
here = os.path.normcase(os.path.abspath(__file__))
if not here.startswith(
os.path.join(dist_loc, __project__)
):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
return 'Please install this project with setup.py'
else:
Expand Down
8 changes: 0 additions & 8 deletions pylmod/tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,3 @@ def test_bad_version(self):
# Test with distribution not found:
mock_distribution.side_effect = DistributionNotFound()
self.assertEqual(_get_version(), error_string)

# Test with loc path not matching
with mock.patch('os.path.abspath') as mock_path:
mock_path.return_value = 'not/where/we/are'
self.assertEqual(_get_version(), error_string)
# Bonus regression test to make sure we are calling
# abspath.
self.assertTrue(mock_path.called)

0 comments on commit 2add6b4

Please sign in to comment.