Update cirros image to 0.4.0
[functest.git] / functest / tests / unit / test_utils.py
1 #!/usr/bin/env python
2
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7
8 import re
9
10
11 class RegexMatch(object):
12     def __init__(self, msg):
13         self.msg = msg
14
15     def __eq__(self, other):
16         match = re.search(self.msg, other)
17         if match:
18             return True
19         return False
20
21
22 class SubstrMatch(object):
23     def __init__(self, msg):
24         self.msg = msg
25
26     def __eq__(self, other):
27         if self.msg in other:
28             return True
29         return False