Best Python code snippet using tavern
test_parse_option.py
Source:test_parse_option.py
1# -*- coding: utf-8 -*-2"""3 test_parse_option4 ~~~~~~~~~~~~~~~~~5 Test parse option.6 :copyright: Copyright 2013 by Takayuki SHIMIZUKAWA.7 :license: BSD, see LICENSE for details.8"""9import os10from nose.tools import raises11from sphinx_intl import commands12from utils import in_tmp13def teardown_module():14 pass15@raises(SystemExit)16@in_tmp()17def test_command_not_found(temp):18 commands.parse_option(['some-command'])19@raises(RuntimeError)20@in_tmp()21def test_confpy_not_have_locale_dirs(temp):22 f = open('conf.py', 'w')23 f.close()24 commands.parse_option(['update'])25@in_tmp()26def test_confpy_have_locale_dirs(temp):27 f = open('conf.py', 'w')28 f.write('locale_dirs=["somedir"]\n')29 f.close()30 opts, args = commands.parse_option(['update'])31 assert opts.locale_dir == 'somedir'32@in_tmp()33def test_confpy_in_subdir(temp):34 os.mkdir('source')35 f = open('source/conf.py', 'w')36 f.write('locale_dirs=["somedir"]\n')37 f.close()38 opts, args = commands.parse_option(['update', '-c', 'source/conf.py'])39 assert opts.locale_dir == os.path.normpath('source/somedir')40@in_tmp()41def test_no_confpy_and_locale_dir_specified(temp):42 opts, args = commands.parse_option(['update', '-d', 'somedir'])...
test_argsparser.py
Source:test_argsparser.py
...23 'matchup': False24 }25 for i in expected_args.keys():26 assert(args[i] == expected_args[i])27 def test_parse_option(self):28 parse_args = SlackArgParse(self.cmd_args, self.options, self.nhl_text)29 args = parse_args.parsed_args30 option = args.parsed_args.option31 assert(option == 'standings')32 def tearDown(self):...
test_option.py
Source:test_option.py
...10 [11 'option "key" "value"',12 ],13)14def test_parse_option(option_parser, text: str):15 option_parser.parse(text)16@pytest.mark.parametrize(17 "text",18 [19 'option "key"',20 'option key "value"',21 "option 'key' 'value'",22 ],23)24def test_parse_bad_option(option_parser, text: str):25 with pytest.raises(UnexpectedInput):...
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!!