Beispiel #1
0
 def test_kwarg_override(self):
     assert lw.get('color', self.b, color='maize') == 'maize'
Beispiel #2
0
 def test_fallback_obj(self):
     assert lw.get('color', self.a, self.b) == 'crimson'
     assert lw.get('size', self.a, self.b) == 2
Beispiel #3
0
 def test_fallback_kwargs(self):
     assert lw.get('color', self.a, self.b, shape='square') == 'crimson'
     assert lw.get('size', self.a, self.b, shape='square') == 2
     assert lw.get('shape', self.a, self.b, shape='square') == 'square'
Beispiel #4
0
 def test_get_obj_attr(self):
     assert lw.get('color', self.a) == 'crimson'
Beispiel #5
0
 def test_get_missing_attr(self):
     assert lw.get('size', self.a) is None
Beispiel #6
0
 def test_kwarg_override(self):
     assert lw.get('color', self.b, color='maize') == 'maize'
Beispiel #7
0
 def test_get_dict_item(self):
     a = {'color': 'gold'}
     assert lw.get('color', a) == 'gold'
Beispiel #8
0
 def test_fallback_kwargs(self):
     assert lw.get('color', self.a, self.b, shape='square') == 'crimson'
     assert lw.get('size', self.a, self.b, shape='square') == 2
     assert lw.get('shape', self.a, self.b, shape='square') == 'square'
Beispiel #9
0
 def test_fallback_obj(self):
     assert lw.get('color', self.a, self.b) == 'crimson'
     assert lw.get('size', self.a, self.b) == 2
Beispiel #10
0
 def test_get_missing_attr(self):
     assert lw.get('size', self.a) is None
Beispiel #11
0
 def test_get_obj_attr(self):
     assert lw.get('color', self.a) == 'crimson'
Beispiel #12
0
 def test_get_dict_item(self):
     a = {'color': 'gold'}
     assert lw.get('color', a) == 'gold'