Пример #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'
     )