-
-
Save vlasovskikh/c4205186445223b4a74f to your computer and use it in GitHub Desktop.
Requirements parsing test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest import TestCase | |
REQUIREMENTS_FILE = './requirements.txt' | |
REQUIRED_PACKAGE = 'Markdown' | |
class RequirementsTest(TestCase): | |
def test_parse_requirements(self): | |
import pkg_resources | |
with open(REQUIREMENTS_FILE, 'rb') as fd: | |
requirements = pkg_resources.parse_requirements(fd.read()) | |
found = None | |
for requirement in requirements: | |
if requirement.key == REQUIRED_PACKAGE.lower(): | |
found = requirement | |
self.assertIsNotNone(found) | |
def test_pip_installed(self): | |
import pip | |
self.assertIsNotNone(pip) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment