Skip to content

Commit 1011945

Browse files
committed
update tests
1 parent 9585a3b commit 1011945

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tests/operators/anomaly/test_anomaly_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
parameters_short.append((m, d))
5353

5454

55-
@pytest.mark.parametrize("model", MODELS)
55+
@pytest.mark.parametrize("model", ["autots"])
5656
def test_artificial_big(model):
5757
all_data = []
5858
TARGET_COLUMN = "sensor"

tests/unitary/with_extras/langchain/test_guardrails.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*--
33

4-
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66

77
import json
@@ -151,7 +151,9 @@ def test_fn(chain: GuardrailSequence):
151151
self.assertIsInstance(output.data, str)
152152
self.assertEqual(output.data, "Tell me a joke about cats")
153153
self.assertIsInstance(output.info, list)
154-
self.assertEqual(len(output.info), len(chain.steps))
154+
self.assertEqual(
155+
len(output.info), len(chain.steps) if hasattr(chain, "steps") else 0
156+
)
155157

156158
self.assert_before_and_after_serialization(test_fn, chain)
157159

@@ -175,7 +177,6 @@ def test_fn(chain: GuardrailSequence):
175177

176178
self.assert_before_and_after_serialization(test_fn, chain)
177179

178-
179180
def test_save_to_file(self):
180181
"""Tests saving to file."""
181182
message = "Let's talk something else."

tests/unitary/with_extras/langchain/test_serialization.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*--
33

4-
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66

77

@@ -142,7 +142,6 @@ def test_llm_chain_serialization_with_oci(self):
142142
self.assertEqual(llm_chain.llm.model, "my_model")
143143
self.assertEqual(llm_chain.input_keys, ["subject"])
144144

145-
146145
def test_oci_gen_ai_serialization(self):
147146
"""Tests serialization of OCI Gen AI LLM."""
148147
try:
@@ -189,7 +188,7 @@ def test_runnable_sequence_serialization(self):
189188

190189
element_1 = kwargs.get("first")
191190
self.assertEqual(element_1.get("_type"), "RunnableParallel")
192-
step = element_1.get("kwargs").get("steps").get("text")
191+
step = element_1.get("kwargs", dict()).get("steps", dict()).get("text", dict())
193192
self.assertEqual(step.get("id")[-1], "RunnablePassthrough")
194193

195194
element_2 = kwargs.get("middle")[0]

0 commit comments

Comments
 (0)