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