Exemplo n.º 1
0
Arquivo: utils.py Projeto: epam/Merlin
 def get_new_files(left,
                   right,
                   left_property_extractor=None,
                   right_property_extractor=None):
     """
     Returns list files that exist in 'left' list and don't exist in 'right' list
     :type left: list
     :type right: list
     :rtype: list
     """
     return ListUtility.diff(left,
                             right,
                             left_property_extractor if left_property_extractor else FileUtils.name_extractor,
                             right_property_extractor if right_property_extractor else FileUtils.name_extractor)
Exemplo n.º 2
0
 def get_new_files(left,
                   right,
                   left_property_extractor=None,
                   right_property_extractor=None):
     """
     Returns list files that exist in 'left' list and don't exist in 'right' list
     :type left: list
     :type right: list
     :rtype: list
     """
     return ListUtility.diff(
         left, right, left_property_extractor if left_property_extractor
         else FileUtils.name_extractor, right_property_extractor
         if right_property_extractor else FileUtils.name_extractor)
Exemplo n.º 3
0
 def test_diff(self):
     list_ = ListUtility.diff(left=self.left, right=self.right)
     self.assertTrue("file001.txt" in list_)
     self.assertTrue("file003.txt" in list_)
     self.assertFalse("file002.txt" in list_)