#640: Refactored generic tests for java#643
Conversation
This reverts commit cf3fcc1.
| # Create UDFs needed for SetWithEmptyInput tests | ||
| self.query(udf.fixindent(''' | ||
| CREATE java SET SCRIPT | ||
| set_returns_has_empty_input(a double) RETURNS boolean AS |
|
|
||
| self.query(udf.fixindent(''' | ||
| CREATE java SET SCRIPT | ||
| set_emits_has_empty_input(a double) EMITS (x double, y varchar(10)) AS |
|
|
||
|
|
||
| class DynamicInputErrors(_JavaUdfSetup): | ||
| def test_exception_wrong_arg(self): |
There was a problem hiding this comment.
We probably can remove the cases for the other languages because this test only handles a single language
| with self.assertRaisesRegex(Exception, err_text[self.LANG]): | ||
| self.query('''select fn1.wrong_arg('a') from dual''') | ||
|
|
||
| def test_exception_wrong_operation(self): |
There was a problem hiding this comment.
We probably can remove the cases for the other languages because this test only handles a single language
| self.query('CREATE SCHEMA FN1') | ||
| self.query('OPEN SCHEMA FN1') | ||
| self.query(udf.fixindent(''' | ||
| CREATE java SCALAR SCRIPT dob_1i_1o(x double) |
| ''')) | ||
| self.query(udf.fixindent(''' | ||
| CREATE java SCALAR SCRIPT line_1i_1o(x double) | ||
| EMITS (y double) AS |
There was a problem hiding this comment.
I think, this is duplicated
| FROM DUAL''') | ||
| self.assertRowsEqual([(True, True, True)], rows) | ||
|
|
||
| @udf.TestCase.expectedFailureIfLang('r') |
There was a problem hiding this comment.
This shouldn't be needed anymore
| FROM DUAL''') | ||
| self.assertRowsEqual([(True, True, True)], rows) | ||
|
|
||
| @udf.TestCase.expectedFailureIfLang('r') |
There was a problem hiding this comment.
This shouldn't be needed anymore
| FROM DUAL''') | ||
| self.assertRowsEqual([(True, True, True, True)], rows) | ||
|
|
||
| @udf.TestCase.expectedFailureIfLang('r') |
There was a problem hiding this comment.
This shouldn't be needed anymore
| foo_conn.query('IMPORT FROM SCRIPT fn1.impal_use_connection_fooconn') | ||
| self.query('drop user foo cascade') | ||
|
|
||
| @skip("IMPORT FROM SCRIPT cannot be used in view definitions") |
There was a problem hiding this comment.
This is actually a test for the DB, we probably can remove it
| self.assertRowEqual(('GET_SCRIPT_NAME',), rows[0]) | ||
|
|
||
| def test_script_schema(self): | ||
| if (udf.opts.is_compat_mode != "true"): |
There was a problem hiding this comment.
This something we need to investigate @sgn4sangar this is a comment for me
| from exasol_python_test_framework import udf | ||
|
|
||
|
|
||
| class Test(udf.TestCase): |
There was a problem hiding this comment.
We need to check if this is complete
|
|
||
| locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') | ||
|
|
||
|
|
There was a problem hiding this comment.
We probably don't need this for java
|
|
||
| class UnicodeData(_JavaUdfSetup): | ||
|
|
||
| # @udf.TestCase.expectedFailureIfLang('lua') |
| ''') | ||
| self.assertRowsEqual([], rows) | ||
|
|
||
| @udf.TestCase.expectedFailureIfLang('lua') |
| parser.add_argument('--server', help='connection string') | ||
| parser.add_argument('--script-languages', help='definition of the SCRIPT_LANGUAGES variable') | ||
| opts, _unknown = parser.parse_known_args() | ||
| setattr(udf, 'pythonVersionInUdf', getPythonVersionInUDFs(opts.server, opts.script_languages)) |
There was a problem hiding this comment.
We probably don't need this
|
|
||
| from exasol_python_test_framework import udf | ||
|
|
||
| udf.pythonVersionInUdf = -1 |
There was a problem hiding this comment.
Can be probably we removed
| ] | ||
|
|
||
| @useData(data) | ||
| def test_vectorsize(self, size): |
There was a problem hiding this comment.
We can probably simplify this, because we know we only run java here
relates to #640
generic tests for java alone
this branch is branched out from refactor/640_bring_db_obs_in_gen_lang_tests