def test_right_alex_installed(self, check_output_mock): check_output_mock.return_value = ( b"Some text here\n" b" Catch insensitive, inconsiderate writing\n" b"Usage instructions and examples here ...." ) self.assertTrue(AlexBear.check_prerequisites())
def test_check_prerequisites(self, check_output_mock): with patch.object(AlexBear.__bases__[1], 'check_prerequisites') as mock_method: mock_method.return_value = False self.assertEqual(False, AlexBear.check_prerequisites())
def test_right_alex_installed(self, check_output_mock): check_output_mock.return_value = ( b'Some text here\n' b' Catch insensitive, inconsiderate writing\n' b'Usage instructions and examples here ....') self.assertTrue(AlexBear.check_prerequisites())
def test_wrong_alex_installed(self, check_output_mock): check_output_mock.return_value = b'Unexpected output from package' self.assertIn("The `alex` package that's been installed seems to " 'be incorrect', AlexBear.check_prerequisites())
def test_unverified_alex_installed(self, check_output_mock): check_output_mock.side_effect = OSError self.assertIn('The `alex` package could not be verified', AlexBear.check_prerequisites())