本文整理汇总了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)
示例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')
示例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")