コード例 #1
0
ファイル: test_webhook.py プロジェクト: karlcow/webcompat.com
 def test_extract_browser_label(self):
     """Extract browser label name."""
     browser_label = helpers.extract_browser_label(self.issue_body)
     self.assertEqual(browser_label, 'browser-firefox')
     browser_label_none = helpers.extract_browser_label(self.issue_body2)
     self.assertEqual(browser_label_none, None)
     browser_label_paren = helpers.extract_browser_label(self.issue_body3)
     self.assertEqual(browser_label_paren, 'browser-firefox-mobile-tablet')
コード例 #2
0
 def test_extract_browser_label(self):
     """Extract browser label name."""
     browser_label = helpers.extract_browser_label(self.issue_body)
     self.assertEqual(browser_label, 'browser-firefox')
     browser_label_none = helpers.extract_browser_label(self.issue_body2)
     self.assertEqual(browser_label_none, None)
     browser_label_paren = helpers.extract_browser_label(self.issue_body3)
     self.assertEqual(browser_label_paren, 'browser-firefox-mobile-tablet')
     browser_label_unicode = helpers.extract_browser_label(self.issue_body4)
     self.assertEqual(browser_label_unicode,
                      'browser-firefox-mobile-tablet')
コード例 #3
0
 def test_extract_browser_label(self):
     """Extract browser label name."""
     metadata_tests = [
         ({
             'browser': 'Firefox'
         }, 'browser-fixme'),
         ({
             'browser': 'Firefox Mobile'
         }, 'browser-fixme'),
         ({
             'browser': 'Firefox99.0'
         }, 'browser-fixme'),
         ({
             'browser': 'Firefox (tablet)'
         }, 'browser-fixme'),
         ({
             'browser': 'Firefox 30.0'
         }, 'browser-firefox'),
         ({
             'browser': 'Firefox Mobile 30.0'
         }, 'browser-firefox-mobile'),
         ({
             'browser': 'Firefox Mobile (Tablet) 88.0'
         }, 'browser-firefox-tablet'),  # noqa
         ({
             'browser': 'Firefox Mobile Nightly 59.0a1 (2017-12-04)'
         }, 'browser-firefox-mobile'),  # noqa
         ({
             'browser':
             'Mozilla/5.0 (Android 8.0.0; Mobile; rv:58.0) Gecko/58.0 Firefox/58.0'
         }, 'browser-fixme'),  # noqa
         ({
             'browser': 'Firefox Developer Edition 60.0b14 (64-bit)'
         }, 'browser-firefox'),  # noqa
         ({
             'browser': 'Firefox Mobile Nightly 61.0 & Firefox PC Nightly'
         }, 'browser-firefox-mobile'),  # noqa
         ({
             'browser': 'LOL Mobile 55.0'
         }, 'browser-fixme'),
         ({
             'browser': 'LOL Mobile 55.0',
             'extra_labels': 'browser-focus-geckoview'
         }, 'browser-fixme'),
         ({
             'browser': 'Firefox 30.0',
             'extra_labels': 'browser-focus-geckoview'
         }, 'browser-firefox'),
         ({}, 'browser-fixme'),
         ({
             'browser': 'Firefox iOS 33.1'
         }, 'browser-firefox-ios'),
     ]
     for metadata_dict, expected in metadata_tests:
         actual = helpers.extract_browser_label(metadata_dict)
         self.assertEqual(expected, actual)
コード例 #4
0
 def test_extract_browser_label(self):
     """Extract browser label name."""
     metadata_tests = [({
         'browser': 'Firefox'
     }, None), ({
         'browser': 'Firefox Mobile'
     }, None), ({
         'browser': 'Firefox99.0'
     }, None), ({
         'browser': 'Firefox (tablet)'
     }, None), ({
         'browser': 'Firefox 30.0'
     }, 'browser-firefox'),
                       ({
                           'browser': 'Firefox Mobile 30.0'
                       }, 'browser-firefox-mobile'),
                       ({
                           'browser': 'Firefox Mobile (Tablet) 88.0'
                       }, 'browser-firefox-mobile-tablet')]
     for metadata_dict, expected in metadata_tests:
         actual = helpers.extract_browser_label(metadata_dict)
         self.assertEqual(expected, actual)
コード例 #5
0
 def test_extract_browser_label(self):
     """Extract browser label name."""
     metadata_tests = [
         ({'browser': 'Firefox'}, 'browser-fixme'),
         ({'browser': 'Firefox Mobile'}, 'browser-fixme'),
         ({'browser': 'Firefox99.0'}, 'browser-fixme'),
         ({'browser': 'Firefox (tablet)'}, 'browser-fixme'),
         ({'browser': 'Firefox 30.0'}, 'browser-firefox'),
         ({'browser': 'Firefox Mobile 30.0'}, 'browser-firefox-mobile'),
         ({'browser': 'Firefox Mobile (Tablet) 88.0'}, 'browser-firefox-tablet'),  # noqa
         ({'browser': 'Firefox Mobile Nightly 59.0a1 (2017-12-04)'}, 'browser-firefox-mobile'),  # noqa
         ({'browser': 'Mozilla/5.0 (Android 8.0.0; Mobile; rv:58.0) Gecko/58.0 Firefox/58.0'}, 'browser-fixme'),  # noqa
         ({'browser': 'Firefox Developer Edition 60.0b14 (64-bit)'}, 'browser-firefox'),  # noqa
         ({'browser': 'Firefox Mobile Nightly 61.0 & Firefox PC Nightly'}, 'browser-firefox-mobile'),  # noqa
         ({'browser': 'LOL Mobile 55.0'}, 'browser-fixme'),
         ({'browser': 'LOL Mobile 55.0',
          'extra_labels': 'browser-focus-geckoview'}, 'browser-fixme'),
          ({'browser': 'Firefox 30.0',
          'extra_labels': 'browser-focus-geckoview'}, 'browser-firefox'),
         ({}, 'browser-fixme'),
     ]
     for metadata_dict, expected in metadata_tests:
         actual = helpers.extract_browser_label(metadata_dict)
         self.assertEqual(expected, actual)
コード例 #6
0
 def test_extract_browser_label(self):
     """Extract browser label name."""
     browser_label = helpers.extract_browser_label(self.issue_body)
     self.assertEqual(browser_label, 'browser-firefox')
     browser_label_none = helpers.extract_browser_label(self.issue_body2)
     self.assertEqual(browser_label_none, None)