def test_submit_if_ready_ok(self, tmpdir, config_prop, tag): xml_content = "<{} foo=bar><properties>".format(tag) xml_file = tmpdir.join("submit_ready.xml") xml_file.write(xml_content) args = dumper_cli.get_args(["-i", str(xml_file)]) submit_args = dumper_cli.get_submit_args(args) with patch("dump2polarion.submit_and_verify", return_value=True): retval = dumper_cli.submit_if_ready(args, submit_args, config_prop) assert retval == 0
def test_submit_if_ready_failed(self, tmpdir, config_prop): xml_content = "<testcases foo=bar>" xml_file = tmpdir.join("submit_failed.xml") xml_file.write(xml_content) args = dumper_cli.get_args(["-i", str(xml_file)]) submit_args = dumper_cli.get_submit_args(args) with patch("dump2polarion.submit_and_verify", return_value=False): retval = dumper_cli.submit_if_ready(args, submit_args, config_prop) assert retval == 2
def test_submit_if_ready_ok(self, tmpdir, config_prop, tag): xml_content = '<{} foo=bar>'.format(tag) xml_file = tmpdir.join('submit_ready.xml') xml_file.write(xml_content) args = dumper_cli.get_args(['-i', str(xml_file)]) submit_args = dumper_cli.get_submit_args(args) with patch('dump2polarion.submit_and_verify', return_value=True): retval = dumper_cli.submit_if_ready(args, submit_args, config_prop) assert retval == 0
def test_submit_if_ready_nosubmit(self, tmpdir, config_prop): xml_content = '<testcases foo=bar>' xml_file = tmpdir.join('submit_nosubmit.xml') xml_file.write(xml_content) args = dumper_cli.get_args(['-i', str(xml_file), '--no-submit']) submit_args = dumper_cli.get_submit_args(args) with patch('dump2polarion.submit_and_verify', return_value=True): retval = dumper_cli.submit_if_ready(args, submit_args, config_prop) assert retval == 0
def test_submit_if_ready_noxml(self, config_prop): args = dumper_cli.get_args(["-i", "submit.txt"]) submit_args = dumper_cli.get_submit_args(args) with patch("dump2polarion.submit_and_verify", return_value=True): retval = dumper_cli.submit_if_ready(args, submit_args, config_prop) assert retval is None