예제 #1
0
 def test__get_complexity_badge_Should_ReturnExpected_When_UseAverage(
         self, badge_patch, *patches):
     complexity_report = {'average': 79, 'highest': {'score': 50}}
     result = get_complexity_badge(complexity_report, use_average=True)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('complexity',
                                         value='Unstable: 79',
                                         default_color='brightred')
예제 #2
0
 def test__get_complexity_badge_Should_ReturnExpected_When_AlarmingRed(
         self, badge_patch, *patches):
     complexity_report = {'highest': {'score': 40}}
     result = get_complexity_badge(complexity_report)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('complexity',
                                         value='Alarming: 40',
                                         default_color='red')
예제 #3
0
 def test__get_complexity_badge_Should_ReturnExpected_When_ComplexOrange(
         self, badge_patch, *patches):
     complexity_report = {'highest': {'score': 30}}
     result = get_complexity_badge(complexity_report)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('complexity',
                                         value='Complex: 30',
                                         default_color='orange')
예제 #4
0
 def test__get_complexity_badge_Should_ReturnExpected_When_SlightYellow(
         self, badge_patch, *patches):
     complexity_report = {'highest': {'score': 20}}
     result = get_complexity_badge(complexity_report)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('complexity',
                                         value='Slight: 20',
                                         default_color='yellow')
예제 #5
0
 def test__get_complexity_badge_Should_ReturnExpected_When_StableGreen(
         self, badge_patch, *patches):
     complexity_report = {'highest': {'score': 10}}
     result = get_complexity_badge(complexity_report)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('complexity',
                                         value='Stable: 10',
                                         default_color='olive')
예제 #6
0
 def test__get_complexity_badge_Should_ReturnExpected_When_UseShields(
         self, badge_patch, *patches):
     complexity_report = {'highest': {'score': 5}}
     result = get_complexity_badge(complexity_report, use_shields=True)
     expected_result = 'https://img.shields.io/badge/complexity-Simple:%205-brightgreen'
     self.assertEqual(result, expected_result)