bea8b9ac53
Implement the minimal changes to the local filesystem storage driver and feed them through the distributed storage driver. Create a digest package which contains digest_tools and checksums. Fix the tests to use the new v1 endpoint locations. Fix repository.delete_instance to properly filter the generated queries to avoid most subquery deletes, but still generate them when not explicitly filtered.
29 lines
940 B
Python
29 lines
940 B
Python
import unittest
|
|
|
|
from endpoints.v1 import v1_bp
|
|
from endpoints.verbs import verbs
|
|
|
|
|
|
class TestAnonymousAccessChecked(unittest.TestCase):
|
|
def verifyBlueprint(self, blueprint):
|
|
class Checker(object):
|
|
def __init__(self, test_case):
|
|
self.test_case = test_case
|
|
|
|
def add_url_rule(self, rule, endpoint, view_function, methods=None):
|
|
if (not '__anon_protected' in dir(view_function) and
|
|
not '__anon_allowed' in dir(view_function)):
|
|
error_message = ('Missing anonymous access protection decorator on function ' +
|
|
'%s under blueprint %s' % (endpoint, blueprint.name))
|
|
self.test_case.fail(error_message)
|
|
|
|
for deferred_function in blueprint.deferred_functions:
|
|
deferred_function(Checker(self))
|
|
|
|
def test_anonymous_access_checked(self):
|
|
self.verifyBlueprint(v1_bp)
|
|
self.verifyBlueprint(verbs)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|
|
|