Best Python code snippet using slash
test_plugin_manager.py
Source:test_plugin_manager.py
...73 ã¯ã©ã¹ã¡ã½ããã®å¼ã³åºãã ããªã®ã§ä¸è¦74 :return:75 '''76 pass77 def test_get_plugin(self):78 '''79 ãã©ã°ã¤ã³åå¾ã®ãã¹ã80 ã»pluginsã«è¿½å ãããã©ã°ã¤ã³ããæå®ããååã§åå¾ã§ãããã¨ã確èª81 :return:82 '''83 plugin = create_base_plugin('test')84 plugins['test'] = plugin85 ok_(isinstance(plugin, get_plugin('test')))86 @raises(Exception)87 def test_get_plugin(self):88 '''89 ãã©ã°ã¤ã³åå¾ã®ãã¹ã90 ã»pluginsã«åå¨ããªãååãæå®ããã¨ä¾å¤ãçºçããäºã確èª91 :return:92 '''93 plugin = create_base_plugin('test')94 plugins['test'] = plugin95 ok_(isinstance(plugin, get_plugin('hoge')))...
TEST_configModify.py
Source:TEST_configModify.py
...4# - prolog marker5from testfwk import create_config, run_test, testfwk_remove_files, try_catch6from testfwk_config import create_hcv7from grid_control.config.cinterface_typed import SimpleConfigInterface8def test_get_plugin(cur, old=None, old_dict=None, cur_dict=None, **kwargs):9 old_dict = old_dict or {}10 cur_dict = cur_dict or {}11 old_dict['key'] = old12 cur_dict['key'] = cur13 hcv = create_hcv(cur_dict, old_dict, print_dict=False)14 config = SimpleConfigInterface(hcv)15 return config.get_plugin('key', **kwargs)16class Test_Config:17 """18 >>> testfwk_remove_files(['work.test_mod/*', 'work.test_mod'])19 >>> config1 = create_config('test_mod.conf')20 >>> print(config1.get('key1', 'k1_def'))21 k1_v122 k1_v223 >>> print(config1.get('key2', 'k2_def'))24 k2_def25 k2_v126 >>> config1_a = config1.change_view(set_sections=['mod', 'section'])27 >>> tmp = config1_a.set('key3', 'k3_v2', '+=')28 >>> print(config1_a.get('key3', 'k3_def'))29 k3_v130 k3_def31 k3_v232 >>> config1.factory.freeze()33 >>> try_catch(lambda: config1_a.set('key fail', 'value'), 'APIError', 'Config container is read-only')34 caught35 >>> config2 = create_config('test_mod.conf')36 >>> print(config2.get('key1', 'k1_def'))37 k1_v138 k1_v239 >>> print(config2.get('key2', 'k2_def'))40 k2_def41 k2_v142 >>> config2_a = config2.change_view(set_sections=['mod', 'section'])43 >>> tmp = config2_a.set('key3', 'k3_v2', '+=')44 >>> print(config2_a.get('key3', 'k3_def'))45 k3_v146 k3_def47 k3_v248 >>> testfwk_remove_files(['work.test_mod/*', 'work.test_mod'])49 >>> test_get_plugin('id', pargs=('1-3',))50 <id:1-3>51 >>> test_get_plugin('IDSelector', pargs=('1-3',))52 <id:1-3>53 >>> test_get_plugin('IDSelector', 'IDSelector', pargs=('1-3',))54 <id:1-3>55 >>> test_get_plugin('id', 'id', pargs=('1-3',))56 <id:1-3>57 >>> test_get_plugin('IDSelector', 'id', pargs=('1-3',))58 <id:1-3>59 >>> test_get_plugin('id', 'IDSelector', pargs=('1-3',))60 <id:1-3>61 >>> test_get_plugin('id', 'state', pargs=('1-3',), on_change=None)62 <id:1-3>63 >>> try_catch(lambda: test_get_plugin('id', 'state', pargs=('1-3',)), 'ConfigError', 'possible to change')64 caught65 >>> test_get_plugin('shell', pargs=('1-3', 'key'), cls='Matcher')66 ShellStyleMatcher(case sensitive = 'key')67 >>> test_get_plugin('ShellStyleMatcher', pargs=('1-3', 'key'), cls='Matcher')68 ShellStyleMatcher(case sensitive = 'key')69 >>> test_get_plugin('ShellStyleMatcher', 'shell', pargs=('1-3', 'key'), cls='Matcher')70 ShellStyleMatcher(case sensitive = 'key')71 >>> test_get_plugin('shell', 'ShellStylematcher', pargs=('1-3', 'key'), cls='Matcher')72 ShellStyleMatcher(case sensitive = 'key')73 >>> test_get_plugin('shell', 'blackwhite', pargs=('1-3', 'key'), cls='Matcher', on_change=None)74 ShellStyleMatcher(case sensitive = 'key')75 >>> try_catch(lambda: test_get_plugin('shell', 'blackwhite', pargs=('1-3', 'key'), cls='Matcher'), 'ConfigError', 'possible to change')76 caught77 """...
test_course_tab_api.py
Source:test_course_tab_api.py
...8class TestCourseTabApi(TestCase):9 """10 Unit tests for the course tab plugin API11 """12 def test_get_plugin(self):13 """14 Verify that get_plugin works as expected.15 """16 tab_type = CourseTabPluginManager.get_plugin("instructor")17 assert tab_type.title == 'Instructor'18 with pytest.raises(PluginError):...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!