Example #1
0
 def test__get_coverage_badge_Should_ReturnExpected_When_Red(
         self, badge_patch, *patches):
     result = get_coverage_badge(54)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('coverage',
                                         value='54%',
                                         default_color='red')
Example #2
0
 def test__get_coverage_badge_Should_ReturnExpected_When_Yellow(
         self, badge_patch, *patches):
     result = get_coverage_badge(84.234342342343)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('coverage',
                                         value='84.23%',
                                         default_color='yellow')
Example #3
0
 def test__get_coverage_badge_Should_ReturnExpected_When_Orange(
         self, badge_patch, *patches):
     result = get_coverage_badge(69.13933332232)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('coverage',
                                         value='69.14%',
                                         default_color='orange')
Example #4
0
 def test__get_coverage_badge_Should_ReturnExpected_When_Green(
         self, badge_patch, *patches):
     result = get_coverage_badge(100)
     self.assertEqual(result, badge_patch.return_value)
     badge_patch.assert_called_once_with('coverage',
                                         value='100%',
                                         default_color='green')
Example #5
0
 def test__get_coverage_badge_Should_ReturnExpected_When_UseShields(
         self, badge_patch, *patches):
     result = get_coverage_badge(54, use_shields=True)
     expected_result = 'https://img.shields.io/badge/coverage-54%25-red'
     self.assertEqual(result, expected_result)