예제 #1
0
def attributes(var):
    """
    Given a variable in the template's context, print and return the list of
    attributes thare accessible inside of the template. For example, private
    attributes or callables that require arguments are excluded.
    """
    attrs = get_attributes(var)
    pprint(attrs)
    return attrs
예제 #2
0
def attributes(var):
    """
    Given a variable in the template's context, print and return the list of
    attributes thare accessible inside of the template. For example, private
    attributes or callables that require arguments are excluded.
    """
    attrs = get_attributes(var)
    pprint(attrs)
    return attrs
예제 #3
0
 def test_valid_list(self):
     valid_attributes = set(get_attributes(self.test_object))
     self.assertEqual(set(['has_kwargs', 'valid_method']), valid_attributes,
         'has_kwargs and valid_method are the only valid routines of TestObject'
     )
예제 #4
0
 def test_valid_list(self):
     valid_attributes = set(get_attributes(self.test_object))
     self.assertEqual(
         set(['has_kwargs', 'valid_method']), valid_attributes,
         'has_kwargs and valid_method are the only valid routines of TestObject'
     )