import unittest

from dq import util


class TestUtil(unittest.TestCase):

    def test_safe_cast(self):
        assert util.safe_cast('1', int) == 1
        assert util.safe_cast('meow', int, 2) == 2

[((9, 15, 9, 39), 'dq.util.safe_cast', 'util.safe_cast', ({(9, 30, 9, 33): '"""1"""', (9, 35, 9, 38): 'int'}, {}), "('1', int)", False, 'from dq import util\n'), ((10, 15, 10, 45), 'dq.util.safe_cast', 'util.safe_cast', ({(10, 30, 10, 36): '"""meow"""', (10, 38, 10, 41): 'int', (10, 43, 10, 44): '(2)'}, {}), "('meow', int, 2)", False, 'from dq import util\n')]