diff --git a/tests/Kiota.Builder.Tests/Writers/Python/CodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/Python/CodeMethodWriterTests.cs index f9142d48c2..64184e1b3a 100644 --- a/tests/Kiota.Builder.Tests/Writers/Python/CodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/Python/CodeMethodWriterTests.cs @@ -791,6 +791,17 @@ public void WritesInheritedDeSerializerBody() Assert.Contains("return fields", result); Assert.DoesNotContain("defined_in_parent", result, StringComparison.OrdinalIgnoreCase); } + + [Fact] + + public void Writes_UnionOfPrimitiveValues_FactoryFunctionAsync() + { + + var result = tw.ToString(); + Assert.Contains("return parseNode?.getNumberValue() ?? parseNode?.getStringValue();", result); + AssertExtensions.CurlyBracesAreClosed(result, 1); + } + [Fact] public void WritesUnionDeSerializerBody() {