示例#1
0
 def test_is_dynamic_resource_dynamic(self):
     resource = Mock(path='/{id}')
     assert utils.is_dynamic_resource(resource)
示例#2
0
 def test_is_dynamic_resource_not_dynamic(self):
     resource = Mock(path='/stories')
     assert not utils.is_dynamic_resource(resource)
示例#3
0
 def test_is_dynamic_resource_no_resource(self):
     assert not utils.is_dynamic_resource(None)
示例#4
0
 def test_is_dynamic_resource_no_resources(self):
     resource = Mock()
     parent = Mock(resources=None)
     resource.parentResource = parent
     assert not utils.is_dynamic_resource(resource)
示例#5
0
 def test_is_dynamic_resource_not_dynamic(self):
     resource = Mock()
     parent = Mock(resources={'/items': resource})
     resource.parentResource = parent
     assert not utils.is_dynamic_resource(resource)
示例#6
0
 def test_is_dynamic_resource(self):
     resource = Mock()
     parent = Mock(resources={'/{id}': resource})
     resource.parentResource = parent
     assert utils.is_dynamic_resource(resource)
示例#7
0
 def test_is_dynamic_resource_no_parent(self):
     resource = Mock(parentResource=None)
     assert not utils.is_dynamic_resource(resource)