Пример #1
0
  def test_choose_reproducible(self):
    """Test choosing being reproducible over nothing."""
    testcase_map = {
        1: self._make_attributes(1, True, None, 11, 10),
        2: self._make_attributes(2, False, None, 11, 1),
    }
    group_leader.choose(testcase_map)

    self.assertTrue(testcase_map[2].is_leader)
    self.assertFalse(testcase_map[1].is_leader)
Пример #2
0
  def test_choose_has_issue_over_reproducible(self):
    """Test choosing having issue over being reproducible."""
    testcase_map = {
        1: self._make_attributes(1, False, None, 22, 10),
        2: self._make_attributes(2, True, '9', 22, 1),
    }
    group_leader.choose(testcase_map)

    self.assertTrue(testcase_map[2].is_leader)
    self.assertFalse(testcase_map[1].is_leader)
Пример #3
0
  def test_choose_reproducible(self):
    """Test choosing being reproducible over nothing."""
    testcase_map = {
        '1': self._make_attributes(True, None, 11, 10),
        '2': self._make_attributes(False, None, 11, 1),
    }
    group_leader.choose(testcase_map)

    self.assertTrue(testcase_map['2'].is_leader)
    self.assertFalse(testcase_map['1'].is_leader)
Пример #4
0
  def test_choose_has_issue_and_reproducible_over_anything_else(self):
    """Test choosing having issue and being reproducible over anything else
      e.g. having issue but not reproducible."""
    testcase_map = {
        1: self._make_attributes(1, True, '10', 33, 10),
        2: self._make_attributes(2, False, None, 33, 9),
        3: self._make_attributes(3, False, '10', 33, 8),
    }
    group_leader.choose(testcase_map)

    self.assertTrue(testcase_map[3].is_leader)
    self.assertFalse(testcase_map[1].is_leader)
    self.assertFalse(testcase_map[2].is_leader)
Пример #5
0
 def test_most_recent(self):
   """Test choosing most recent when there's no high-quality testcase."""
   testcase_map = {
       1: self._make_attributes(1, True, None, 11, 10),
       2: self._make_attributes(2, True, None, 11, 1),
       3: self._make_attributes(3, True, None, 22, 10),
       4: self._make_attributes(4, True, None, 22, 1)
   }
   group_leader.choose(testcase_map)
   self.assertTrue(testcase_map[1].is_leader)
   self.assertFalse(testcase_map[2].is_leader)
   self.assertTrue(testcase_map[3].is_leader)
   self.assertFalse(testcase_map[4].is_leader)
Пример #6
0
  def test_choose_has_issue_and_reproducible_over_anything_else(self):
    """Test choosing having issue and being reproducible over anything else
      e.g. having issue but not reproducible."""
    testcase_map = {
        '1': self._make_attributes(True, '10', 33, 10),
        '2': self._make_attributes(False, None, 33, 9),
        '3': self._make_attributes(False, '10', 33, 8),
    }
    group_leader.choose(testcase_map)

    self.assertTrue(testcase_map['3'].is_leader)
    self.assertFalse(testcase_map['1'].is_leader)
    self.assertFalse(testcase_map['2'].is_leader)
Пример #7
0
 def test_most_recent(self):
   """Test choosing most recent when there's no high-quality testcase."""
   testcase_map = {
       '1': self._make_attributes(True, None, 11, 10),
       '2': self._make_attributes(True, None, 11, 1),
       '3': self._make_attributes(True, None, 22, 10),
       '4': self._make_attributes(True, None, 22, 1)
   }
   group_leader.choose(testcase_map)
   self.assertTrue(testcase_map['1'].is_leader)
   self.assertFalse(testcase_map['2'].is_leader)
   self.assertTrue(testcase_map['3'].is_leader)
   self.assertFalse(testcase_map['4'].is_leader)
Пример #8
0
 def test_empty(self):
   """Test empty."""
   testcase_map = {}
   group_leader.choose(testcase_map)
   self.assertDictEqual({}, testcase_map)