def test_resource_endpoint_return_right_type_for_children_collection(self): self.assertEqual(_resource_endpoint(self.collection_uri + '/records'), ('collection', True)) self.assertEqual(_resource_endpoint(self.bucket_uri + '/collections'), ('bucket', True)) self.assertEqual(_resource_endpoint(self.bucket_uri + '/groups'), ('bucket', True))
def test_resource_endpoint_return_right_type_for_children_collection(self): self.assertEqual( _resource_endpoint("/buckets/bid/collections/cid/records"), ("collection", True) ) self.assertEqual(_resource_endpoint("/buckets/bid/collections"), ("bucket", True)) self.assertEqual(_resource_endpoint("/buckets/bid/history"), ("bucket", True)) self.assertEqual(_resource_endpoint("/buckets/bid/groups"), ("bucket", True))
def test_resource_endpoint_return_right_type_for_children_collection(self): self.assertEqual( _resource_endpoint("/buckets/bid/collections/cid/records"), ("collection", True) ) self.assertEqual(_resource_endpoint("/buckets/bid/collections"), ("bucket", True)) self.assertEqual(_resource_endpoint("/buckets/bid/history"), ("bucket", True)) self.assertEqual(_resource_endpoint("/buckets/bid/groups"), ("bucket", True))
def test_resource_endpoint_return_right_type_for_key(self): self.assertEqual(_resource_endpoint(self.record_uri), ('record', False)) self.assertEqual(_resource_endpoint(self.collection_uri), ('collection', False)) self.assertEqual(_resource_endpoint(self.bucket_uri), ('bucket', False)) self.assertEqual(_resource_endpoint(self.group_uri), ('group', False)) self.assertRaises(ValueError, _resource_endpoint, self.invalid_uri)
def test_resource_endpoint_return_right_type_for_children_collection(self): self.assertEqual( _resource_endpoint('/buckets/bid/collections/cid/records'), ('collection', True)) self.assertEqual(_resource_endpoint('/buckets/bid/collections'), ('bucket', True)) self.assertEqual(_resource_endpoint('/buckets/bid/history'), ('bucket', True)) self.assertEqual(_resource_endpoint('/buckets/bid/groups'), ('bucket', True))
def test_resource_endpoint_return_right_type_for_key(self): self.assertEqual( _resource_endpoint("/buckets/bid/collections/cid/records/rid"), ("record", False) ) self.assertEqual(_resource_endpoint("/buckets/bid/collections/cid"), ("collection", False)) self.assertEqual(_resource_endpoint("/buckets"), ("", False)) self.assertEqual(_resource_endpoint("/buckets/bid"), ("bucket", False)) self.assertEqual(_resource_endpoint("/buckets/bid/history/xx"), ("history", False)) self.assertEqual(_resource_endpoint("/buckets/bid/groups/moderators"), ("group", False))
def test_resource_endpoint_return_right_type_for_key(self): self.assertEqual( _resource_endpoint("/buckets/bid/collections/cid/records/rid"), ("record", False) ) self.assertEqual(_resource_endpoint("/buckets/bid/collections/cid"), ("collection", False)) self.assertEqual(_resource_endpoint("/buckets"), ("", False)) self.assertEqual(_resource_endpoint("/buckets/bid"), ("bucket", False)) self.assertEqual(_resource_endpoint("/buckets/bid/history/xx"), ("history", False)) self.assertEqual(_resource_endpoint("/buckets/bid/groups/moderators"), ("group", False))
def test_resource_endpoint_return_right_type_for_key(self): self.assertEqual(_resource_endpoint('/buckets/bid/collections/cid/records/rid'), ('record', False)) self.assertEqual(_resource_endpoint('/buckets/bid/collections/cid'), ('collection', False)) self.assertEqual(_resource_endpoint('/buckets'), ('', False)) self.assertEqual(_resource_endpoint('/buckets/bid'), ('bucket', False)) self.assertEqual(_resource_endpoint('/buckets/bid/history/xx'), ('history', False)) self.assertEqual(_resource_endpoint('/buckets/bid/groups/moderators'), ('group', False))
def test_resource_endpoint_return_right_type_for_key(self): self.assertEqual( _resource_endpoint('/buckets/bid/collections/cid/records/rid'), ('record', False)) self.assertEqual(_resource_endpoint('/buckets/bid/collections/cid'), ('collection', False)) self.assertEqual(_resource_endpoint('/buckets'), ('', False)) self.assertEqual(_resource_endpoint('/buckets/bid'), ('bucket', False)) self.assertEqual(_resource_endpoint('/buckets/bid/history/xx'), ('history', False)) self.assertEqual(_resource_endpoint('/buckets/bid/groups/moderators'), ('group', False))
def test_resource_endpoint_return_right_type_for_children_collection(self): self.assertEqual(_resource_endpoint('/buckets/bid/collections/cid/records'), ('collection', True)) self.assertEqual(_resource_endpoint('/buckets/bid/collections'), ('bucket', True)) self.assertEqual(_resource_endpoint('/buckets/bid/history'), ('bucket', True)) self.assertEqual(_resource_endpoint('/buckets/bid/groups'), ('bucket', True))