當前位置: 首頁>>代碼示例>>Python>>正文


Python Language.find_by_alias方法代碼示例

本文整理匯總了Python中libs.language.Language.find_by_alias方法的典型用法代碼示例。如果您正苦於以下問題:Python Language.find_by_alias方法的具體用法?Python Language.find_by_alias怎麽用?Python Language.find_by_alias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在libs.language.Language的用法示例。


在下文中一共展示了Language.find_by_alias方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_find_all_by_alias

# 需要導入模塊: from libs.language import Language [as 別名]
# 或者: from libs.language.Language import find_by_alias [as 別名]
 def test_find_all_by_alias(self):
     for language in Language.all():
         for name in language.aliases:
             assert language == Language.find_by_alias(name)
開發者ID:arthur503,項目名稱:linguist,代碼行數:6,代碼來源:test_language.py

示例2: test_find_by_alias

# 需要導入模塊: from libs.language import Language [as 別名]
# 或者: from libs.language.Language import find_by_alias [as 別名]
 def test_find_by_alias(self):
     assert Language.find_by_name('ASP') == Language.find_by_alias('asp')
     assert Language.find_by_name('ASP') == Language.find_by_alias('aspx')
     assert Language.find_by_name('ASP') == Language.find_by_alias('aspx-vb')
     assert Language.find_by_name('ActionScript') == Language.find_by_alias('as3')
     assert Language.find_by_name('ApacheConf') == Language.find_by_alias('apache')
     assert Language.find_by_name('Assembly') == Language.find_by_alias('nasm')
     assert Language.find_by_name('Batchfile') == Language.find_by_alias('bat')
     assert Language.find_by_name('C#') == Language.find_by_alias('c#')
     assert Language.find_by_name('C#') == Language.find_by_alias('csharp')
     assert Language.find_by_name('C') == Language.find_by_alias('c')
     assert Language.find_by_name('C++') == Language.find_by_alias('c++')
     assert Language.find_by_name('C++') == Language.find_by_alias('cpp')
     assert Language.find_by_name('CoffeeScript') == Language.find_by_alias('coffee')
     assert Language.find_by_name('CoffeeScript') == Language.find_by_alias('coffee-script')
     assert Language.find_by_name('ColdFusion') == Language.find_by_alias('cfm')
     assert Language.find_by_name('Common Lisp') == Language.find_by_alias('common-lisp')
     assert Language.find_by_name('Common Lisp') == Language.find_by_alias('lisp')
     assert Language.find_by_name('Darcs Patch') == Language.find_by_alias('dpatch')
     assert Language.find_by_name('Dart') == Language.find_by_alias('dart')
     assert Language.find_by_name('Emacs Lisp') == Language.find_by_alias('elisp')
     assert Language.find_by_name('Emacs Lisp') == Language.find_by_alias('emacs')
     assert Language.find_by_name('Emacs Lisp') == Language.find_by_alias('emacs-lisp')
     assert Language.find_by_name('Gettext Catalog') == Language.find_by_alias('pot')
     assert Language.find_by_name('HTML') == Language.find_by_alias('html')
     assert Language.find_by_name('HTML') == Language.find_by_alias('xhtml')
     assert Language.find_by_name('HTML+ERB') == Language.find_by_alias('html+erb')
     assert Language.find_by_name('HTML+ERB') == Language.find_by_alias('erb')
     assert Language.find_by_name('IRC log') == Language.find_by_alias('irc')
     assert Language.find_by_name('JSON') == Language.find_by_alias('json')
     assert Language.find_by_name('Java Server Pages') == Language.find_by_alias('jsp')
     assert Language.find_by_name('Java') == Language.find_by_alias('java')
     assert Language.find_by_name('JavaScript') == Language.find_by_alias('javascript')
     assert Language.find_by_name('JavaScript') == Language.find_by_alias('js')
     assert Language.find_by_name('Literate Haskell') == Language.find_by_alias('lhs')
     assert Language.find_by_name('Literate Haskell') == Language.find_by_alias('literate-haskell')
     assert Language.find_by_name('Objective-C') == Language.find_by_alias('objc')
     assert Language.find_by_name('OpenEdge ABL') == Language.find_by_alias('openedge')
     assert Language.find_by_name('OpenEdge ABL') == Language.find_by_alias('progress')
     assert Language.find_by_name('OpenEdge ABL') == Language.find_by_alias('abl')
     assert Language.find_by_name('Parrot Internal Representation') == Language.find_by_alias('pir')
     assert Language.find_by_name('PowerShell') == Language.find_by_alias('posh')
     assert Language.find_by_name('Puppet') == Language.find_by_alias('puppet')
     assert Language.find_by_name('Pure Data') == Language.find_by_alias('pure-data')
     assert Language.find_by_name('Raw token data') == Language.find_by_alias('raw')
     assert Language.find_by_name('Ruby') == Language.find_by_alias('rb')
     assert Language.find_by_name('Ruby') == Language.find_by_alias('ruby')
     assert Language.find_by_name('Scheme') == Language.find_by_alias('scheme')
     assert Language.find_by_name('Shell') == Language.find_by_alias('bash')
     assert Language.find_by_name('Shell') == Language.find_by_alias('sh')
     assert Language.find_by_name('Shell') == Language.find_by_alias('shell')
     assert Language.find_by_name('Shell') == Language.find_by_alias('zsh')
     assert Language.find_by_name('TeX') == Language.find_by_alias('tex')
     assert Language.find_by_name('TypeScript') == Language.find_by_alias('ts')
     assert Language.find_by_name('VimL') == Language.find_by_alias('vim')
     assert Language.find_by_name('VimL') == Language.find_by_alias('viml')
     assert Language.find_by_name('reStructuredText') == Language.find_by_alias('rst')
     assert Language.find_by_name('YAML') == Language.find_by_alias('yml')
開發者ID:arthur503,項目名稱:linguist,代碼行數:60,代碼來源:test_language.py

示例3: test_find_by_alias

# 需要導入模塊: from libs.language import Language [as 別名]
# 或者: from libs.language.Language import find_by_alias [as 別名]
 def test_find_by_alias(self):
     assert Language["ASP"] == Language.find_by_alias("asp")
     assert Language["ASP"] == Language.find_by_alias("aspx")
     assert Language["ASP"] == Language.find_by_alias("aspx-vb")
     assert Language["ActionScript"] == Language.find_by_alias("as3")
     assert Language["ApacheConf"] == Language.find_by_alias("apache")
     assert Language["Assembly"] == Language.find_by_alias("nasm")
     assert Language["Batchfile"] == Language.find_by_alias("bat")
     assert Language["C#"] == Language.find_by_alias("c#")
     assert Language["C#"] == Language.find_by_alias("csharp")
     assert Language["C"] == Language.find_by_alias("c")
     assert Language["C++"] == Language.find_by_alias("c++")
     assert Language["C++"] == Language.find_by_alias("cpp")
     assert Language["CoffeeScript"] == Language.find_by_alias("coffee")
     assert Language["CoffeeScript"] == Language.find_by_alias("coffee-script")
     assert Language["ColdFusion"] == Language.find_by_alias("cfm")
     assert Language["Common Lisp"] == Language.find_by_alias("common-lisp")
     assert Language["Common Lisp"] == Language.find_by_alias("lisp")
     assert Language["Darcs Patch"] == Language.find_by_alias("dpatch")
     assert Language["Dart"] == Language.find_by_alias("dart")
     assert Language["Emacs Lisp"] == Language.find_by_alias("elisp")
     assert Language["Emacs Lisp"] == Language.find_by_alias("emacs")
     assert Language["Emacs Lisp"] == Language.find_by_alias("emacs-lisp")
     assert Language["Gettext Catalog"] == Language.find_by_alias("pot")
     assert Language["HTML"] == Language.find_by_alias("html")
     assert Language["HTML"] == Language.find_by_alias("xhtml")
     assert Language["HTML+ERB"] == Language.find_by_alias("html+erb")
     assert Language["HTML+ERB"] == Language.find_by_alias("erb")
     assert Language["IRC log"] == Language.find_by_alias("irc")
     assert Language["JSON"] == Language.find_by_alias("json")
     assert Language["Java Server Pages"] == Language.find_by_alias("jsp")
     assert Language["Java"] == Language.find_by_alias("java")
     assert Language["JavaScript"] == Language.find_by_alias("javascript")
     assert Language["JavaScript"] == Language.find_by_alias("js")
     assert Language["Literate Haskell"] == Language.find_by_alias("lhs")
     assert Language["Literate Haskell"] == Language.find_by_alias("literate-haskell")
     assert Language["Objective-C"] == Language.find_by_alias("objc")
     assert Language["OpenEdge ABL"] == Language.find_by_alias("openedge")
     assert Language["OpenEdge ABL"] == Language.find_by_alias("progress")
     assert Language["OpenEdge ABL"] == Language.find_by_alias("abl")
     assert Language["Parrot Internal Representation"] == Language.find_by_alias("pir")
     assert Language["PowerShell"] == Language.find_by_alias("posh")
     assert Language["Puppet"] == Language.find_by_alias("puppet")
     assert Language["Pure Data"] == Language.find_by_alias("pure-data")
     assert Language["Raw token data"] == Language.find_by_alias("raw")
     assert Language["Ruby"] == Language.find_by_alias("rb")
     assert Language["Ruby"] == Language.find_by_alias("ruby")
     assert Language["Scheme"] == Language.find_by_alias("scheme")
     assert Language["Shell"] == Language.find_by_alias("bash")
     assert Language["Shell"] == Language.find_by_alias("sh")
     assert Language["Shell"] == Language.find_by_alias("shell")
     assert Language["Shell"] == Language.find_by_alias("zsh")
     assert Language["TeX"] == Language.find_by_alias("tex")
     assert Language["TypeScript"] == Language.find_by_alias("ts")
     assert Language["VimL"] == Language.find_by_alias("vim")
     assert Language["VimL"] == Language.find_by_alias("viml")
     assert Language["reStructuredText"] == Language.find_by_alias("rst")
     assert Language["YAML"] == Language.find_by_alias("yml")
開發者ID:mrajashree,項目名稱:linguist,代碼行數:60,代碼來源:test_language.py


注:本文中的libs.language.Language.find_by_alias方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。