Best Python code snippet using refurb_python
test_arg_parsing.py
Source:test_arg_parsing.py
...55def test_quiet_flag_parsing() -> None:56 assert parse_args(["--quiet", "file"]) == Settings(57 files=["file"], quiet=True58 )59def test_generate_subcommand() -> None:60 assert parse_args(["gen"]) == Settings(generate=True)61def test_load_flag() -> None:62 assert parse_args(["--load", "some_module"]) == Settings(63 load=["some_module"]64 )65def test_parse_load_flag_missing_arg() -> None:66 with pytest.raises(67 ValueError, match='refurb: missing argument after "--load"'68 ):69 parse_args(["--load"])70def test_parse_config_file_flag_missing_arg() -> None:71 with pytest.raises(72 ValueError, match='refurb: missing argument after "--config-file"'73 ):...
test_init.py
Source:test_init.py
...26 main()27 self.assertEqual(28 self.inventory.assert_called_with("path"), None,29 )30 def test_generate_subcommand(self):31 self.parser_args.subcommand = "generate"32 main()33 self.assertTrue(self.inventory.return_value.generate.called)34 def test_generate_subcommand_with_resource_type(self):35 self.parser_args.subcommand = "generate"36 self.parser_args.resource_type = "ec2"37 main()38 self.inventory.return_value.generate.assert_called_with("ec2")39 @patch("clinv.SearchReport")40 def test_search_subcommand(self, reportMock):41 self.parser_args.subcommand = "search"42 self.parser_args.search_string = "inst"43 main()44 self.assertTrue(self.inventory.return_value.load.called)...
test_main.py
Source:test_main.py
...63 test/e2e/dummy.py64 ExpressionStmt:1(65 StrExpr(\\u000aThis is a dummy file just to make sure that the refurb command is installed\\u000aand running correctly.\\u000a)))"""66 ]67def test_generate_subcommand():68 with patch("refurb.main.generate") as p:69 main(["gen"])70 p.assert_called_once()71def test_help_flag_calls_print():72 for args in (["--help"], ["-h"], []):73 with patch("builtins.print") as p:74 main(args) # type: ignore75 p.assert_called_once()76 assert "usage" in p.call_args[0][0]77def test_version_flag_calls_version_func():78 for args in (["--version"], ["-v"]):79 with patch("refurb.main.version") as p:80 main(args)81 p.assert_called_once()...
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!!