tools/variations/split_variations_cmd_unittest.py
def _VerifySplits(self, switch_name, splits, ref_switch_data):
    """Verifies splitting commandline switches works correctly.

    Compare that when we combine switch data from all |splits| into one,
    it's exactly the same as the |ref_switch_data|. Also check the splits are
    almost evenly distributed, that is, their data size are almost the same.

    Args:
        switch_name: The name of the switch that is verified.
        splits: A list of {switch_name: [items]} dictionaries.
                Each list element represents one of the split switch sets.
                |items| is a list of items representing switch value.
        ref_switch_data: A {switch_name: [items]} dictionary.
                         This is the switch set before splitting.
                         |items| is a list of items representing switch value.
    """
    data_lists = [
        split[switch_name] for split in splits if switch_name in split]
    if len(data_lists) == 0:
      self.assertFalse(ref_switch_data)
      return
    max_size = max(len(data) for data in data_lists)
    min_size = min(len(data) for data in data_lists)
    if switch_name != _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME:
      self.assertTrue(max_size - min_size <= 1)
    joined_switch_data = []
    for data in data_lists:
      joined_switch_data.extend(data)
    self.assertEqual(ref_switch_data, joined_switch_data)
Verifies splitting commandline switches works correctly.

    Compare that when we combine switch data from all |splits| into one,
    it's exactly the same as the |ref_switch_data|. Also check the splits are
    almost evenly distributed, that is, their data size are almost the same.

    Args:
        switch_name: The name of the switch that is verified.
        splits: A list of {switch_name: [items]} dictionaries.
                Each list element represents one of the split switch sets.
                |items| is a list of items representing switch value.
        ref_switch_data: A {switch_name: [items]} dictionary.
                         This is the switch set before splitting.
                         |items| is a list of items representing switch value.
    
Verifies splitting commandline switches works correctly.
Compare that when we combine switch data from all |splits| into one,
it's exactly the same as the |ref_switch_data|. Also check the splits are
almost evenly distributed, that is, their data size are almost the same.
Verifies splitting commandline switches works correctly . Compare that when we combine switch data from all |splits| into one it ' s exactly the same as the |ref_switch_data| . Also check the splits are almost evenly distributed that is their data size are almost the same .
def _VerifySplits(self, switch_name, splits, ref_switch_data):
    data_lists = [
        split[switch_name] for split in splits if switch_name in split]
    if len(data_lists) == 0:
      self.assertFalse(ref_switch_data)
      return
    max_size = max(len(data) for data in data_lists)
    min_size = min(len(data) for data in data_lists)
    if switch_name != _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME:
      self.assertTrue(max_size - min_size <= 1)
    joined_switch_data = []
    for data in data_lists:
      joined_switch_data.extend(data)
    self.assertEqual(ref_switch_data, joined_switch_data)
def _VerifySplits ( self , switch_name , splits , ref_switch_data ) : data_lists = [ split [ switch_name ] for split in splits if switch_name in split ] if len ( data_lists ) == 0 : self . assertFalse ( ref_switch_data ) return max_size = max ( len ( data ) for data in data_lists ) min_size = min ( len ( data ) for data in data_lists ) if switch_name != _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME : self . assertTrue ( max_size - min_size <= 1 ) joined_switch_data = [ ] for data in data_lists : joined_switch_data . extend ( data ) self . assertEqual ( ref_switch_data , joined_switch_data )
Verifies splitting commandline switches works correctly.
Verifies splitting commandline switches works correctly .
"""Verifies splitting commandline switches works correctly.

    Compare that when we combine switch data from all |splits| into one,
    it's exactly the same as the |ref_switch_data|. Also check the splits are
    almost evenly distributed, that is, their data size are almost the same.

    Args:
        switch_name: The name of the switch that is verified.
        splits: A list of {switch_name: [items]} dictionaries.
                Each list element represents one of the split switch sets.
                |items| is a list of items representing switch value.
        ref_switch_data: A {switch_name: [items]} dictionary.
                         This is the switch set before splitting.
                         |items| is a list of items representing switch value.
    """
self
switch_name
The name of the switch that is verified.
The name of the switch that is verified .
splits
A list of {switch_name: [items]} dictionaries.
Each list element represents one of the split switch sets.
|items| is a list of items representing switch value.
A list of { switch_name : [ items ] } dictionaries . Each list element represents one of the split switch sets . |items| is a list of items representing switch value .
ref_switch_data
A {switch_name: [items]} dictionary.
This is the switch set before splitting.
|items| is a list of items representing switch value.
A { switch_name : [ items ] } dictionary . This is the switch set before splitting . |items| is a list of items representing switch value .