예제 #1
0
 def test_simple_condition(self):
     """ test simple condition """
     filter_ = data_models.Filter('state=A', data_models.Replica)
     assert filter_.match(self.replica_1)
     assert not filter_.match(self.replica_2)
예제 #2
0
 def test_multiple_conditions(self):
     """ test multiple conditions """
     filter_ = data_models.Filter('size=42,state=A', data_models.Replica)
     assert filter_.match(self.replica_1)
     assert not filter_.match(self.replica_2)
예제 #3
0
 def test_multiple_conditions(self):
     """ test multiple conditions """
     filter_ = data_models.Filter('size=42,state=A', data_models.Replica)
     ok_(filter_.match(self.replica_1), self.replica_1.size)  # pylint: disable=no-member
     ok_(not filter_.match(self.replica_2), self.replica_2.size)  # pylint: disable=no-member