def test_get_all_bears(self): with bear_test_module(): bears = get_all_bears() assert isinstance(bears, list) for bear in bears: assert issubclass(bear, Bear) self.assertSetEqual({b.name for b in bears}, set(TEST_BEAR_NAMES))
def test_get_all_bears(self): with bear_test_module(): bears = get_all_bears() assert isinstance(bears, list) for bear in bears: assert issubclass(bear, Bear) self.assertSetEqual( {b.name for b in bears}, set(TEST_BEAR_NAMES))
def test_get_all_bears(self): with bear_test_module(): bears = get_all_bears() assert isinstance(bears, list) for bear in bears: assert issubclass(bear, Bear) self.assertSetEqual( {b.name for b in bears}, { 'DependentBear', 'EchoBear', 'LineCountTestBear', 'JavaTestBear', 'SpaceConsistencyTestBear', 'TestBear' })
def test_get_all_bears(self): with bear_test_module(): bears = get_all_bears() assert isinstance(bears, list) for bear in bears: assert issubclass(bear, Bear) self.assertSetEqual( {b.name for b in bears}, {'DependentBear', 'EchoBear', 'LineCountTestBear', 'JavaTestBear', 'SpaceConsistencyTestBear', 'TestBear'})
def test_get_all_bears(self): with bear_test_module(): bears = get_all_bears() assert isinstance(bears, list) for bear in bears: assert issubclass(bear, Bear) self.assertSetEqual( {b.name for b in bears}, { 'DependentBear', 'EchoBear', 'LineCountTestBear', 'JavaTestBear', 'SpaceConsistencyTestBear', 'TestBear', 'ErrorTestBear', 'RaiseTestBear', 'TestDepBearA', 'TestDepBearBDependsA', 'TestDepBearCDependsB', 'TestDepBearAA', 'AspectTestBear', 'TestDepBearDependsAAndAA' })
def test_filter_relevant_bears_green_mode(self): from argparse import Namespace invalid_bears = ['DocGrammarBear', 'DocumentationStyleBear'] self.arg_parser.parse_args = unittest.mock.MagicMock( return_value=Namespace(green_mode=True)) res = filter_relevant_bears([('Python', 70), ('C', 20)], self.printer, self.arg_parser, {}) for lang in res: result = list( filter( lambda x: next((False for bear in invalid_bears if bear in str(x)), True), list(res[lang]))) to_compare = list( filter(lambda x: lang in x.LANGUAGES, get_all_bears())) self.assertCountEqual(result, to_compare)
def test_get_all_bears(self): with bear_test_module(): bears = get_all_bears() assert isinstance(bears, list) for bear in bears: assert issubclass(bear, Bear) self.assertSetEqual( {b.name for b in bears}, {'DependentBear', 'EchoBear', 'LineCountTestBear', 'JavaTestBear', 'SpaceConsistencyTestBear', 'TestBear', 'ErrorTestBear', 'RaiseTestBear', 'TestDepBearA', 'TestDepBearBDependsA', 'TestDepBearCDependsB', 'TestDepBearAA', 'AspectTestBear', 'TestDepBearDependsAAndAA'})