mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-09 14:06:30 +00:00
parent
d083bd1365
commit
527b714d34
@ -108,7 +108,9 @@ BAD_RESPONSE = {
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"tagFQN": "myTaghasMoreThanOneHundredAndTwentyCharactersAndItShouldBreakPydanticModelValidation.myTaghasMoreThanOneHundredAndTwentyCharactersAndItShouldBreakPydanticModelValidation",
|
||||
# Certain test cases are expected to fail as tagFQN's
|
||||
# value is not a string to test out the skip_on_failure
|
||||
"tagFQN": 123,
|
||||
"source": "Classification",
|
||||
"labelType": "Manual",
|
||||
"state": "Confirmed",
|
||||
|
||||
@ -25,6 +25,8 @@ CLASSIFICATION_NAME = "TestTag"
|
||||
PRIMARY_TAG_NAME = "TestPrimaryTag"
|
||||
SECONDARY_TAG_NAME = "TestSecondaryTag"
|
||||
TEST_SPECIAL_CHARS_TAG_NAME = "Test/Sepcial_Chars/Tag"
|
||||
LONG_CLASSIFICATION_NAME = "A" * 256
|
||||
LONG_PRIMARY_TAG_NAME = "B" * 256
|
||||
|
||||
|
||||
class OMetaTagMixinPost(TestCase):
|
||||
@ -132,3 +134,28 @@ class OMetaTagMixinPost(TestCase):
|
||||
).entities
|
||||
|
||||
self.assertIsNotNone(tags)
|
||||
|
||||
def test_c_create_classifications(self):
|
||||
"""Test POST classification for long name"""
|
||||
|
||||
classification = CreateClassificationRequest(
|
||||
description="test tag", name=LONG_CLASSIFICATION_NAME
|
||||
)
|
||||
|
||||
classification: Classification = self.metadata.create_or_update(classification)
|
||||
self.assertEqual(classification.name.root, LONG_CLASSIFICATION_NAME)
|
||||
|
||||
def test_d_create_tag(self):
|
||||
"""Test POST tag creation with long name"""
|
||||
create_primary_tag = CreateTagRequest(
|
||||
name=LONG_PRIMARY_TAG_NAME,
|
||||
classification=LONG_CLASSIFICATION_NAME,
|
||||
description="test tag",
|
||||
)
|
||||
|
||||
primary_tag: Tag = self.metadata.create_or_update(create_primary_tag)
|
||||
self.assertEqual(primary_tag.name.root, LONG_PRIMARY_TAG_NAME)
|
||||
self.assertEqual(
|
||||
primary_tag.fullyQualifiedName,
|
||||
f"{LONG_CLASSIFICATION_NAME}.{LONG_PRIMARY_TAG_NAME}",
|
||||
)
|
||||
|
||||
@ -7,8 +7,7 @@
|
||||
"javaType": "org.openmetadata.schema.type.TagLabel",
|
||||
"definitions": {
|
||||
"tagFQN": {
|
||||
"type": "string",
|
||||
"maxLength": 128
|
||||
"type": "string"
|
||||
},
|
||||
"TagSource": {
|
||||
"type": "string",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user