MCPcopy Create free account
hub / github.com/apache/kudu / test_bad_partialrow

Method test_bad_partialrow

python/kudu/tests/test_client.py:709–731  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

707 assert tserver.port() is not None
708
709 def test_bad_partialrow(self):
710 table = self.client.table(self.ex_table)
711 op = table.new_insert()
712 # Test bad keys or indexes
713 keys = [
714 ('not-there', KeyError),
715 (len(self.schema) + 1, IndexError),
716 (-1, IndexError)
717 ]
718
719 for key in keys:
720 with self.assertRaises(key[1]):
721 op[key[0]] = 'test'
722
723 # Test incorrectly typed data
724 error_msg = 'an integer is required'
725 with self.assertRaisesRegex(TypeError, error_msg):
726 op['int_val'] = 'incorrect'
727
728 # Test setting NULL in a not-null column
729 error_msg = 'column not nullable: key'
730 with self.assertRaisesRegex(kudu.errors.KuduInvalidArgument, error_msg):
731 op['key'] = None
732
733 def test_alter_table_rename(self):
734 try:

Callers

nothing calls this directly

Calls 2

assertRaisesRegexMethod · 0.80
tableMethod · 0.45

Tested by

no test coverage detected