Skip to content

Commit

Permalink
test: Add test cases for TupleParameter invalid string handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ikyasam18 committed Nov 26, 2024
1 parent 95444a3 commit 4fcfaec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/parameter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,18 @@ class Foo(luigi.Task):
self.assertEqual(hash(Foo(args=('foo', 'bar')).args),
hash(p.normalize(p.parse('["foo", "bar"]'))))

def test_tuple_invalid_string(self):
param = luigi.TupleParameter()
self.assertRaises(ValueError, lambda: param.parse('("abcd")'))

def test_tuple_invalid_string_in_tuple(self):
param = luigi.TupleParameter()
self.assertRaises(ValueError, lambda: param.parse('(("abcd"))'))

def test_parse_invalid_format(self):
param = luigi.TupleParameter()
self.assertRaises(SyntaxError, lambda: param.parse('((1,2),(3,4'))

def test_task(self):
class Bar(luigi.Task):
pass
Expand Down Expand Up @@ -1225,6 +1237,7 @@ class LocalParameters1304Test(LuigiTestCase):
https://github.com/spotify/luigi/issues/1304#issuecomment-148402284
"""

def test_local_params(self):

class MyTask(RunOnceTask):
Expand Down

0 comments on commit 4fcfaec

Please sign in to comment.