mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 21:32:01 +00:00
Add self.assertNotNested() in CreateString
And also add a test case. If you try to nest CreateString you will get a clear exception.
This commit is contained in:
@@ -1130,6 +1130,13 @@ class TestExceptions(unittest.TestCase):
|
||||
assertRaises(self, lambda: b.PrependUOffsetTRelative(1),
|
||||
flatbuffers.builder.OffsetArithmeticError)
|
||||
|
||||
def test_create_string_is_nested_error(self):
|
||||
b = flatbuffers.Builder(0)
|
||||
b.StartObject(0)
|
||||
s = 'test1'
|
||||
assertRaises(self, lambda: b.CreateString(s),
|
||||
flatbuffers.builder.ObjectIsNestedError)
|
||||
|
||||
|
||||
def CheckAgainstGoldDataGo():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user