Exemple #1
0
    def test_parse(self):
        # Setup
        user_input = ['name,ascending', 'version,descending', 'release,ascending']

        # Test
        parsed = criteria_utils.parse_sort(CriteriaCommand, user_input)

        # Verify
        self.assertEqual(3, len(parsed))
        parsed.sort(key=lambda x: x[0])
        self.assertEqual(parsed[0][0], 'name')
        self.assertEqual(parsed[0][1], 'ascending')
        self.assertEqual(parsed[1][0], version_utils.RELEASE_INDEX)
        self.assertEqual(parsed[1][1], 'ascending')
        self.assertEqual(parsed[2][0], version_utils.VERSION_INDEX)
        self.assertEqual(parsed[2][1], 'descending')
    def test_parse(self):
        # Setup
        user_input = ['name,ascending', 'version,descending', 'release,ascending']

        # Test
        parsed = criteria_utils.parse_sort(CriteriaCommand, user_input)

        # Verify
        self.assertEqual(3, len(parsed))
        parsed.sort(key=lambda x : x[0])
        self.assertEqual(parsed[0][0], 'name')
        self.assertEqual(parsed[0][1], 'ascending')
        self.assertEqual(parsed[1][0], version_utils.RELEASE_INDEX)
        self.assertEqual(parsed[1][1], 'ascending')
        self.assertEqual(parsed[2][0], version_utils.VERSION_INDEX)
        self.assertEqual(parsed[2][1], 'descending')
Exemple #3
0
 def _parse_sort(cls, sort_args):
     return criteria_utils.parse_sort(DisplayUnitAssociationsCommand, sort_args)
Exemple #4
0
 def _parse_sort(cls, sort_args):
     return criteria_utils.parse_sort(RecursiveCopyCommand, sort_args)
Exemple #5
0
 def _parse_sort(cls, sort_args):
     return criteria_utils.parse_sort(BaseRemoveCommand, sort_args)
Exemple #6
0
 def _parse_sort(cls, sort_args):
     return criteria_utils.parse_sort(BaseRemoveCommand, sort_args)