def test_multiple_correct_arguments(self): '''Test `validate_types` with multiple correct arguments''' client_utils.validate_types(( ('name', protocol.STRING), ('age', protocol.Option(protocol.UINT32)), ), ('name', None, ))
def test_multiple_correct_arguments(self): '''Test `validate_types` with multiple correct arguments''' client_utils.validate_types(( ('name', protocol.STRING), ('age', protocol.Option(protocol.UINT32)), ), ( 'name', None, ))
def test_single_incorrect_argument(self): '''Test `validate_types` if one incorrect argument is provided''' run_test = lambda value: client_utils.validate_types( (('i', protocol.UINT32), ), (value, )) self.assertRaises(ValueError, run_test, -1) self.assertRaises(TypeError, run_test, '1')
def test_multiple_incorrect_arguments(self): '''Test `validate_types` with multiple incorrect arguments''' run_test = lambda value: client_utils.validate_types(( ('name', protocol.STRING), ('age', protocol.Option(protocol.UINT32)), ), ('name', value, )) self.assertRaises(ValueError, run_test, -1) self.assertRaises(TypeError, run_test, '1')
def test_multiple_incorrect_arguments(self): '''Test `validate_types` with multiple incorrect arguments''' run_test = lambda value: client_utils.validate_types(( ('name', protocol.STRING), ('age', protocol.Option(protocol.UINT32)), ), ( 'name', value, )) self.assertRaises(ValueError, run_test, -1) self.assertRaises(TypeError, run_test, '1')
def test_single_correct_argument(self): '''Test `validate_types` if one correct argument is provided''' client_utils.validate_types((('name', protocol.STRING), ), ('name', ))
def test_no_arguments(self): '''Test `validate_types` if no arguments are expected''' client_utils.validate_types((), ())