Skip to content

Instantly share code, notes, and snippets.

@VGonPa
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VGonPa/59c196ea90dbbf9fdfb2 to your computer and use it in GitHub Desktop.
Save VGonPa/59c196ea90dbbf9fdfb2 to your computer and use it in GitHub Desktop.
Sublime snippets
<snippet>
<content><![CDATA[
def test_${1:name_of_the_test}(self):
${2:self.fail()}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>test_method</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
<snippet>
<content><![CDATA[
PKG = '${1:package_name}'
${2:import unittest}
class Test${3:ClassName}(unittest.TestCase):
def __init__(self, *args):
super(Test${3:ClassName}, self).__init__(*args)
def setUp(self):
pass
def tearDown(self):
pass
def test_${4:name_of_the_method_to_test}(self):
$6
if __name__ == '__main__':
import rosunit
rosunit.unitrun(PKG, 'test_${5:name}', Test${3:ClassName})
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>rosunit</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
<snippet>
<content><![CDATA[
class Test${3:ClassName}(unittest.TestCase):
def __init__(self, *args):
super(Test${3:ClassName}, self).__init__(*args)
def setUp(self):
pass
def tearDown(self):
pass
def test_${4:name_of_the_method_to_test}(self):
$6
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>TestClass</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment