本文整理匯總了Python中reverser.RSRReverser.get_option_start方法的典型用法代碼示例。如果您正苦於以下問題:Python RSRReverser.get_option_start方法的具體用法?Python RSRReverser.get_option_start怎麽用?Python RSRReverser.get_option_start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類reverser.RSRReverser
的用法示例。
在下文中一共展示了RSRReverser.get_option_start方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_rsrreverse_get_option_start_end
# 需要導入模塊: from reverser import RSRReverser [as 別名]
# 或者: from reverser.RSRReverser import get_option_start [as 別名]
def test_rsrreverse_get_option_start_end():
route = '/test[]'
reverser = RSRReverser(route)
pos = len(route) - 2
assert reverser.get_option_start() == pos
示例2: test_rsrreverser_get_option_start_no_end
# 需要導入模塊: from reverser import RSRReverser [as 別名]
# 或者: from reverser.RSRReverser import get_option_start [as 別名]
def test_rsrreverser_get_option_start_no_end():
reverser = RSRReverser('/[start/no/end')
assert reverser.get_option_start() == -1
示例3: test_rsrreverser_get_option_end_no_start
# 需要導入模塊: from reverser import RSRReverser [as 別名]
# 或者: from reverser.RSRReverser import get_option_start [as 別名]
def test_rsrreverser_get_option_end_no_start():
reverser = RSRReverser('/end]/no/start')
assert reverser.get_option_start() == -1
示例4: test_rsrreverse_get_option_start_none
# 需要導入模塊: from reverser import RSRReverser [as 別名]
# 或者: from reverser.RSRReverser import get_option_start [as 別名]
def test_rsrreverse_get_option_start_none():
reverser = RSRReverser('/no/start')
assert reverser.get_option_start() == -1
示例5: test_rsrreverse_get_option_start_start
# 需要導入模塊: from reverser import RSRReverser [as 別名]
# 或者: from reverser.RSRReverser import get_option_start [as 別名]
def test_rsrreverse_get_option_start_start():
reverser = RSRReverser('[/{option}]/test')
assert reverser.get_option_start() == 0
示例6: test_rsrreverse_get_option_start_after_end
# 需要導入模塊: from reverser import RSRReverser [as 別名]
# 或者: from reverser.RSRReverser import get_option_start [as 別名]
def test_rsrreverse_get_option_start_after_end():
reverser = RSRReverser('/sep]/[test')
assert reverser.get_option_start() == -1
示例7: test_rsrreverse_get_option_start_multiple
# 需要導入模塊: from reverser import RSRReverser [as 別名]
# 或者: from reverser.RSRReverser import get_option_start [as 別名]
def test_rsrreverse_get_option_start_multiple():
reverser = RSRReverser('/sep/[test]/[end]')
assert reverser.get_option_start() == 5
示例8: test_rsrreverse_get_option_start_middle
# 需要導入模塊: from reverser import RSRReverser [as 別名]
# 或者: from reverser.RSRReverser import get_option_start [as 別名]
def test_rsrreverse_get_option_start_middle():
reverser = RSRReverser('/[test]/sep')
assert reverser.get_option_start() == 1