Exemplo n.º 1
0
 def test_kwarg_override(self):
     assert lw.get('color', self.b, color='maize') == 'maize'
Exemplo n.º 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
Exemplo n.º 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'
Exemplo n.º 4
0
 def test_get_obj_attr(self):
     assert lw.get('color', self.a) == 'crimson'
Exemplo n.º 5
0
 def test_get_missing_attr(self):
     assert lw.get('size', self.a) is None
Exemplo n.º 6
0
 def test_kwarg_override(self):
     assert lw.get('color', self.b, color='maize') == 'maize'
Exemplo n.º 7
0
 def test_get_dict_item(self):
     a = {'color': 'gold'}
     assert lw.get('color', a) == 'gold'
Exemplo n.º 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'
Exemplo n.º 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
Exemplo n.º 10
0
 def test_get_missing_attr(self):
     assert lw.get('size', self.a) is None
Exemplo n.º 11
0
 def test_get_obj_attr(self):
     assert lw.get('color', self.a) == 'crimson'
Exemplo n.º 12
0
 def test_get_dict_item(self):
     a = {'color': 'gold'}
     assert lw.get('color', a) == 'gold'