コード例 #1
0
def test_sum_up_lists():
    list_a = [['a', 1], ['b', 5]]
    list_b = [['c', 3], ['b', 1]]
    result = sum_up_lists(list_a, list_b)
    assert len(result) == 3, 'number of entries not correct'
    assert ['a', 1] in result
    assert ['b', 6] in result
    assert ['c', 3] in result
コード例 #2
0
ファイル: update.py プロジェクト: schneiderderek/FACT_core
 def _get_objects_and_count_of_occurrence_firmware_and_file_db(
         self, object_path, unwind=False, match=None):
     result_firmwares = self._get_objects_and_count_of_occurrence_single_db(
         self.db.firmwares, object_path, unwind=unwind, match=match)
     result_files = self._get_objects_and_count_of_occurrence_single_db(
         self.db.file_objects, object_path, unwind=unwind, match=match)
     combined_result = sum_up_lists(result_firmwares, result_files)
     return combined_result