diff options
author | Andy Davidoff <andy+github@disruptek.com> | 2014-07-19 16:12:21 -0400 |
---|---|---|
committer | Andy Davidoff <andy+github@disruptek.com> | 2014-07-19 16:12:21 -0400 |
commit | b3e4d0bac5a4079e5513396cc26a3cad50332dda (patch) | |
tree | 47786aa6c1494143b1ca8034fddd49374dd60069 /tests | |
parent | 12057c1bcf25809ae03818d912977e417551b8b8 (diff) | |
download | boto-b3e4d0bac5a4079e5513396cc26a3cad50332dda.tar.gz |
add an assertion of @requires decorators order
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/mws/test_connection.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/mws/test_connection.py b/tests/unit/mws/test_connection.py index abfd2588..2c2c6057 100644 --- a/tests/unit/mws/test_connection.py +++ b/tests/unit/mws/test_connection.py @@ -82,6 +82,21 @@ doc/2009-01-01/"> destructure_object(user, result, prefix='Prefix', members=members) self.assertEqual(result, amazon) + def test_decorator_order(self): + for action, func in api_call_map.items(): + func = getattr(self.service_connection, func) + decs = [func.__name__] + while func: + i = 0 + while i < len(func.__closure__): + value = func.__closure__[i].cell_contents + if hasattr(value, '__call__'): + if 'requires' == value.__name__: + self.assertTrue(not decs or decs[-1] == 'requires') + decs.append(value.__name__) + i += 1 + func = getattr(func, '__wrapped__', None) + def test_built_api_call_map(self): # Ensure that the map is populated. # It starts empty, but the decorators should add to it as they're |