MCPcopy Create free account
hub / github.com/StackStorm/st2 / test_print

Method test_print

st2common/tests/unit/test_db_base.py:61–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

59
60class TestBaseModel(DbTestCase):
61 def test_print(self):
62 instance = FakeModel(
63 name="seesaw",
64 boolean_field=True,
65 datetime_field=date_utils.get_datetime_utc_now(),
66 description="fun!",
67 dict_field={"a": 1},
68 integer_field=68,
69 list_field=["abc"],
70 )
71
72 expected = (
73 'FakeModel(boolean_field=True, datetime_field="%s", description="fun!", '
74 "dict_field={'a': 1}, id=None, integer_field=68, list_field=['abc'], "
75 'name="seesaw")' % str(instance.datetime_field)
76 )
77
78 self.assertEqual(str(instance), expected)
79
80 def test_rule_print(self):
81 instance = FakeRuleModel(

Callers

nothing calls this directly

Calls 1

FakeModelClass · 0.70

Tested by

no test coverage detected