Skip to content

Commit cb1c309

Browse files
committed
tests: fix failures from latest features
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
1 parent 10d64f5 commit cb1c309

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/test_cmds.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
import pytest
4141

42+
from tests.testing.factories import config_factory
4243
from tests.testing.factories import image_factory
4344
from tests.testing.factories import instance_factory
4445
from tests.testing.rich import FakeTable
@@ -53,6 +54,7 @@ def mock_ctx():
5354
mock_ctx = es.enter_context(
5455
mock.patch("yo.main.YoCtx"),
5556
).return_value
57+
mock_ctx.config = config_factory()
5658
mock_con = es.enter_context(
5759
mock.patch(
5860
"rich.console.Console",

tests/testing/factories.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,14 @@ def instance_factory(**kwargs) -> YoInstance:
9292
"time_created": now() - datetime.timedelta(seconds=60),
9393
"image_id": _random_id(),
9494
"termination_protected": False,
95+
"created_by": MY_EMAIL,
9596
"freeform_tags": {TERMPROTECT: "false"},
9697
"username": None,
9798
}
9899
defaults.update(kwargs)
100+
defaults["defined_tags"] = {
101+
"Oracle-Tags": {"CreatedBy": defaults.pop("created_by")},
102+
}
99103
return YoInstance(**defaults) # type: ignore
100104

101105

@@ -130,6 +134,8 @@ def config_factory(**kwargs) -> YoConfig:
130134
"my_username": "test",
131135
"ssh_public_key": "/fake/path/to/id_rsa.pub",
132136
"region": "fake-testing-region",
137+
"list_columns": "Name,Shape,Mem,CPU,State,Created",
138+
"silence_automatic_tag_warning": True,
133139
}
134140
defaults.update(kwargs)
135141
return YoConfig(**defaults) # type: ignore

0 commit comments

Comments
 (0)