Example #1
0
 def test_mocked_status_message_why(self, util):
     util.module_exists.return_value = False
     dep = PythonModuleDependency('sys', why="system functions")
     self.assertFalse(dep.is_available)
     expected = "MISSING   sys                 needed for system functions, install using pip"
     self.assertEqual(dep.printable_status, expected)
Example #2
0
 def test_mocked_status_message(self, util):
     util.module_exists.return_value = False
     dep = PythonModuleDependency('sys')
     self.assertFalse(dep.is_available)
     expected = "MISSING   sys                 install using pip"
     self.assertEqual(dep.printable_status, expected)
Example #3
0
 def test_missing_dependency(self):
     dep = PythonModuleDependency('foobarnonexistent')
     self.assertFalse(dep.is_available)
Example #4
0
 def test_mocked_dependency(self, util):
     util.module_exists.return_value = True
     dep = PythonModuleDependency('requests2')
     self.assertTrue(dep.is_available)
     self.assertEqual(dep.printable_status, "INSTALLED requests2")
Example #5
0
 def test_existing_dependency(self):
     dep = PythonModuleDependency('sys')
     self.assertTrue(dep.is_available)