コード例 #1
0
ファイル: CollectorsTest.py プロジェクト: zhanhb/coala
 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))
コード例 #2
0
ファイル: CollectorsTest.py プロジェクト: Anmolbansal1/coala
 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))
コード例 #3
0
ファイル: CollectorsTest.py プロジェクト: zenara/coala
 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'
              })
コード例 #4
0
ファイル: CollectorsTest.py プロジェクト: RohanVB/coala
 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'})
コード例 #5
0
 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'
              })
コード例 #6
0
 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)
コード例 #7
0
ファイル: CollectorsTest.py プロジェクト: Eoghan-Murphy/coala
 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'})