Best Python code snippet using refurb_python
test_main.py
Source:test_main.py
...107 except UnicodeDecodeError:108 setlocale(LC_ALL, "")109 raise110 setlocale(LC_ALL, "")111def test_load_custom_config_file():112 args = [113 "test/data/err_101.py",114 "--quiet",115 "--config-file",116 "test/config/config.toml",117 ]118 errors = run_refurb(load_settings(args))...
test_config.py
Source:test_config.py
...3from financeager import config as cfg4from financeager import exceptions5from financeager_flask import main6class ConfigTestCase(unittest.TestCase):7 def test_load_custom_config_file(self):8 # create custom config file, modify service name9 filepath = "/tmp/{}".format(int(time.time()))10 with open(filepath, "w") as file:11 file.write("[SERVICE]\nname = flask\n")12 config = cfg.Configuration(filepath=filepath, plugins=[main.main()])13 self.assertEqual(config.get_option("SERVICE", "name"), "flask")14 def test_invalid_config(self):15 filepath = "/tmp/{}".format(int(time.time()))16 for content in ("[SERVICE:FLASK]\ntimeout = foo\n",):17 with open(filepath, "w") as file:18 file.write(content)19 self.assertRaises(20 exceptions.InvalidConfigError,21 cfg.Configuration,...
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!!