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 setUp(self): self.section = Section("test section") self.uut = AlexBear(self.section, Queue()) self.test_file1 = os.path.join(os.path.dirname(__file__), "test_files", "alex_test1.md") self.test_file2 = os.path.join(os.path.dirname(__file__), "test_files", "alex_test2.md")
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())