def test_groups(self): # Test a couple identity cases assert Language.find_by_name('Perl') == Language.find_by_name( 'Perl').group assert Language.find_by_name('Python') == Language.find_by_name( 'Python').group assert Language.find_by_name('Ruby') == Language.find_by_name( 'Ruby').group # Test a few special groups assert Language.find_by_name('Assembly') == Language.find_by_name( 'GAS').group assert Language.find_by_name('C') == Language.find_by_name( 'OpenCL').group assert Language.find_by_name('Haskell') == Language.find_by_name( 'Literate Haskell').group assert Language.find_by_name('Java') == Language.find_by_name( 'Java Server Pages').group assert Language.find_by_name('Python') == Language.find_by_name( 'Cython').group assert Language.find_by_name('Python') == Language.find_by_name( 'NumPy').group assert Language.find_by_name('Shell') == Language.find_by_name( 'Batchfile').group assert Language.find_by_name('Shell') == Language.find_by_name( 'Gentoo Ebuild').group assert Language.find_by_name('Shell') == Language.find_by_name( 'Gentoo Eclass').group assert Language.find_by_name('Shell') == Language.find_by_name( 'Tcsh').group # Ensure everyone has a group for language in Language.all(): assert language.group, "%s has no group" % language
def test_primary_extension(self): assert ".pl" == Language["Perl"].primary_extension assert ".py" == Language["Python"].primary_extension assert ".rb" == Language["Ruby"].primary_extension assert ".js" == Language["JavaScript"].primary_extension assert ".coffee" == Language["CoffeeScript"].primary_extension assert ".t" == Language["Turing"].primary_extension assert ".ts" == Language["TypeScript"].primary_extension # This is a nasty requirement, but theres some code in GitHub that # expects this. Really want to drop this. for language in Language.all(): assert language.primary_extension, "%s has no primary extension" % language
def test_primary_extension(self): assert '.pl' == Language['Perl'].primary_extension assert '.py' == Language['Python'].primary_extension assert '.rb' == Language['Ruby'].primary_extension assert '.js' == Language['JavaScript'].primary_extension assert '.coffee' == Language['CoffeeScript'].primary_extension assert '.t' == Language['Turing'].primary_extension assert '.ts' == Language['TypeScript'].primary_extension # This is a nasty requirement, but theres some code in GitHub that # expects this. Really want to drop this. for language in Language.all(): assert language.primary_extension, "%s has no primary extension" % language
def test_primary_extension(self): assert '.pl' == Language.find_by_name('Perl').primary_extension assert '.py' == Language.find_by_name('Python').primary_extension assert '.rb' == Language.find_by_name('Ruby').primary_extension assert '.js' == Language.find_by_name('JavaScript').primary_extension assert '.coffee' == Language.find_by_name('CoffeeScript').primary_extension assert '.t' == Language.find_by_name('Turing').primary_extension assert '.ts' == Language.find_by_name('TypeScript').primary_extension # This is a nasty requirement, but theres some code in GitHub that # expects this. Really want to drop this. for language in Language.all(): assert language.primary_extension, "%s has no primary extension" % language
def test_groups(self): # Test a couple identity cases assert Language['Perl'] == Language['Perl'].group assert Language['Python'] == Language['Python'].group assert Language['Ruby'] == Language['Ruby'].group # Test a few special groups assert Language['Assembly'] == Language['GAS'].group assert Language['C'] == Language['OpenCL'].group assert Language['Haskell'] == Language['Literate Haskell'].group assert Language['Java'] == Language['Java Server Pages'].group assert Language['Python'] == Language['Cython'].group assert Language['Python'] == Language['NumPy'].group assert Language['Shell'] == Language['Batchfile'].group assert Language['Shell'] == Language['Gentoo Ebuild'].group assert Language['Shell'] == Language['Gentoo Eclass'].group assert Language['Shell'] == Language['Tcsh'].group # Ensure everyone has a group for language in Language.all(): assert language.group, "%s has no group" % language
def test_groups(self): # Test a couple identity cases assert Language.find_by_name('Perl') == Language.find_by_name('Perl').group assert Language.find_by_name('Python') == Language.find_by_name('Python').group assert Language.find_by_name('Ruby') == Language.find_by_name('Ruby').group # Test a few special groups assert Language.find_by_name('Assembly') == Language.find_by_name('GAS').group assert Language.find_by_name('C') == Language.find_by_name('OpenCL').group assert Language.find_by_name('Haskell') == Language.find_by_name('Literate Haskell').group assert Language.find_by_name('Java') == Language.find_by_name('Java Server Pages').group assert Language.find_by_name('Python') == Language.find_by_name('Cython').group assert Language.find_by_name('Python') == Language.find_by_name('NumPy').group assert Language.find_by_name('Shell') == Language.find_by_name('Batchfile').group assert Language.find_by_name('Shell') == Language.find_by_name('Gentoo Ebuild').group assert Language.find_by_name('Shell') == Language.find_by_name('Gentoo Eclass').group assert Language.find_by_name('Shell') == Language.find_by_name('Tcsh').group # Ensure everyone has a group for language in Language.all(): assert language.group, "%s has no group" % language
def test_groups(self): # Test a couple identity cases assert Language["Perl"] == Language["Perl"].group assert Language["Python"] == Language["Python"].group assert Language["Ruby"] == Language["Ruby"].group # Test a few special groups assert Language["Assembly"] == Language["GAS"].group assert Language["C"] == Language["OpenCL"].group assert Language["Haskell"] == Language["Literate Haskell"].group assert Language["Java"] == Language["Java Server Pages"].group assert Language["Python"] == Language["Cython"].group assert Language["Python"] == Language["NumPy"].group assert Language["Shell"] == Language["Batchfile"].group assert Language["Shell"] == Language["Gentoo Ebuild"].group assert Language["Shell"] == Language["Gentoo Eclass"].group assert Language["Shell"] == Language["Tcsh"].group # Ensure everyone has a group for language in Language.all(): assert language.group, "%s has no group" % language
def test_find_all_by_alias(self): for language in Language.all(): for name in language.aliases: assert language == Language.find_by_alias(name)
def test_find_all_by_name(self): for language in Language.all(): assert language == Language.find_by_name(language.name) assert language == Language.name_index[language.name]