def test_xls2xform_convert_throwing_odk_error(self, parser_mock_args): """ Parse and validate bad_calc.xlsx """ logger = logging.getLogger("pyxform.xls2xform") with mock.patch.object(logger, "error") as mock_debug: main_cli() self.assertEqual(mock_debug.call_count, 1)
def test_xls2form_convert_parameters(self, converter_mock, parser_mock_args): """ Checks that xls2xform_convert is given the right arguments, when the output-path is not given """ converter_mock.return_value = "{}" main_cli() converter_mock.assert_called_once_with( xlsform_path="xlsform.xlsx", xform_path="xlsform.xml", validate=False, pretty_print=False, enketo=False, )
def test_xls2form_convert_parameters(self, converter_mock, parser_mock_args): """ Checks that xls2xform_convert is given the right arguments, when the output-path is not given """ converter_mock.return_value = "{}" main_cli() converter_mock.assert_called_once_with( xlsform_path="xlsform.xlsx", xform_path="xlsform.xml", validate=False, pretty_print=False, enketo=False, )
def test_xls2xform_convert_params_with_flags(self, converter_mock, parser_mock_args): """ Should call xlsform_convert with the correct input for output path where only the xlsform input path and json flag were provided, since the xlsform-convert can be called if json flag was set or when not """ converter_mock.return_value = "{}" main_cli() converter_mock.assert_called_once_with( xlsform_path="xlsform.xlsx", xform_path="xlsform.xml", validate=False, pretty_print=False, enketo=False, )
def test_xls2xform_convert_params_with_flags( self, converter_mock, parser_mock_args ): """ Should call xlsform_convert with the correct input for output path where only the xlsform input path and json flag were provided, since the xlsform-convert can be called if json flag was set or when not """ converter_mock.return_value = "{}" main_cli() converter_mock.assert_called_once_with( xlsform_path="xlsform.xlsx", xform_path="xlsform.xml", validate=False, pretty_print=False, enketo=False, )