示例#1
0
 def testGetStatusDictRawMessage(self):
   """Tests that _GetStatusDict stores raw message if requested."""
   self._SetupMockTreeStatusResponses(final_tree_status='Tree is open (taco).',
                                      final_general_state=constants.TREE_OPEN)
   data = tree_status._GetStatusDict(self.status_url, raw_message=True)
   self.assertEqual(data[tree_status.TREE_STATUS_MESSAGE],
                    'Tree is open (taco).')
示例#2
0
 def testGetStatusDictEmptyMessage(self):
   """Tests that _GetStatusDict stores an empty string for unknown format."""
   self._SetupMockTreeStatusResponses(
       final_tree_status='Tree is throttled. foo canary -> crbug.com/bar',
       final_general_state=constants.TREE_OPEN)
   data = tree_status._GetStatusDict(self.status_url)
   self.assertEqual(data[tree_status.TREE_STATUS_MESSAGE], '')
 def testGetStatusDictRawMessage(self):
     """Tests that _GetStatusDict stores raw message if requested."""
     self._SetupMockTreeStatusResponses(
         final_tree_status="Tree is open (taco).", final_general_state=constants.TREE_OPEN
     )
     data = tree_status._GetStatusDict(self.status_url, raw_message=True)
     self.assertEqual(data[tree_status.TREE_STATUS_MESSAGE], "Tree is open (taco).")
 def testGetStatusDictEmptyMessage(self):
     """Tests that _GetStatusDict stores an empty string for unknown format."""
     self._SetupMockTreeStatusResponses(
         final_tree_status="Tree is throttled. foo canary -> crbug.com/bar", final_general_state=constants.TREE_OPEN
     )
     data = tree_status._GetStatusDict(self.status_url)
     self.assertEqual(data[tree_status.TREE_STATUS_MESSAGE], "")
示例#5
0
 def testGetStatusDictParsesMessage(self):
   """Tests that _GetStatusDict parses message correctly."""
   self._SetupMockTreeStatusResponses(
       final_tree_status='Tree is throttled (foo canary: taco investigating)',
       final_general_state=constants.TREE_OPEN)
   data = tree_status._GetStatusDict(self.status_url)
   self.assertEqual(data[tree_status.TREE_STATUS_MESSAGE],
                    'foo canary: taco investigating')
 def testGetStatusDictParsesMessage(self):
     """Tests that _GetStatusDict parses message correctly."""
     self._SetupMockTreeStatusResponses(
         final_tree_status="Tree is throttled (foo canary: taco investigating)",
         final_general_state=constants.TREE_OPEN,
     )
     data = tree_status._GetStatusDict(self.status_url)
     self.assertEqual(data[tree_status.TREE_STATUS_MESSAGE], "foo canary: taco investigating")