| Total Complexity | 4 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import unittest |
||
| 6 | @unittest.skipIf(shutil.which('pip') is None, "Pip is not installed.") |
||
| 7 | class PipRequirementTestCase(unittest.TestCase): |
||
| 8 | |||
| 9 | def test_Install_Command_With_Version(self): |
||
| 10 | self.assertIn('-m pip install setuptools==19.2', |
||
| 11 | PipRequirement('setuptools', '19.2').install_command()) |
||
| 12 | |||
| 13 | def test_Install_Command_Without_Version(self): |
||
| 14 | self.assertIn('-m pip install setuptools', |
||
| 15 | PipRequirement('setuptools').install_command()) |
||
| 16 | |||
| 17 | def test_InstalledRequirement(self): |
||
| 18 | self.assertTrue(PipRequirement('pip').is_installed()) |
||
| 19 | |||
| 20 | def test_NotInstalledRequirement(self): |
||
| 21 | self.assertFalse(PipRequirement('some_bad_package').is_installed()) |
||
| 22 |