コード例 #1
0
ファイル: test_criteria.py プロジェクト: taftsanders/pulp
 def test__get_patterns_for_not_noop(self):
     """
     Test that _get_patterns_for_not does nothing to the filter if there is no `$not` operator.
     """
     some_filter = {'key': {'$eq': 'value'}}
     filter_copy = criteria._get_patterns_for_not(some_filter)
     self.assertEqual(some_filter, filter_copy)
コード例 #2
0
ファイル: test_criteria.py プロジェクト: alexxa/pulp
 def test__get_patterns_for_not_noop(self):
     """
     Test that _get_patterns_for_not does nothing to the filter if there is no `$not` operator.
     """
     some_filter = {'key': {'$eq': 'value'}}
     filter_copy = criteria._get_patterns_for_not(some_filter)
     self.assertEqual(some_filter, filter_copy)
コード例 #3
0
ファイル: test_criteria.py プロジェクト: taftsanders/pulp
 def test__get_patterns_for_not(self):
     """
     Test that a pattern is obtained from the regex object.
     """
     regex = '^regexp?$'
     some_filter = {'key': {'$not': re.compile(regex)}}
     filter_copy = criteria._get_patterns_for_not(some_filter)
     self.assertEqual(filter_copy['key']['$not'], regex)
コード例 #4
0
ファイル: test_criteria.py プロジェクト: alexxa/pulp
 def test__get_patterns_for_not(self):
     """
     Test that a pattern is obtained from the regex object.
     """
     regex = '^regexp?$'
     some_filter = {'key': {'$not': re.compile(regex)}}
     filter_copy = criteria._get_patterns_for_not(some_filter)
     self.assertEqual(filter_copy['key']['$not'], regex)