Set source type: Stub for black tests with options (#9674)

This commit is contained in:
Micha Reiser 2024-01-29 15:54:30 +01:00 committed by GitHub
parent bea8f2ee3a
commit 0045032905
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 124 additions and 37 deletions

View file

@ -1 +1 @@
{"preview": "enabled"}
{"preview": "enabled", "source_type": "Stub"}

View file

@ -34,3 +34,23 @@ my_dict = {
}))))
}),
}
class Random:
def func():
random_service.status.active_states.inactive = (
make_new_top_level_state_from_dict(
{
"topLevelBase": {
"secondaryBase": {
"timestamp": 1234,
"latitude": 1,
"longitude": 2,
"actionTimestamp": Timestamp(
seconds=1530584000, nanos=0
).ToJsonString(),
}
},
}
)
)

View file

@ -47,3 +47,21 @@ my_dict = {
}
),
}
class Random:
def func():
random_service.status.active_states.inactive = (
make_new_top_level_state_from_dict({
"topLevelBase": {
"secondaryBase": {
"timestamp": 1234,
"latitude": 1,
"longitude": 2,
"actionTimestamp": (
Timestamp(seconds=1530584000, nanos=0).ToJsonString()
),
}
},
})
)

View file

@ -0,0 +1 @@
{"preview": "enabled"}

View file

@ -0,0 +1,3 @@
{
"is_update": (up := commit.hash in update_hashes)
}

View file

@ -0,0 +1 @@
{"is_update": (up := commit.hash in update_hashes)}

View file

@ -68,6 +68,9 @@ def import_fixture(fixture: Path, fixture_set: str):
options_path = fixture_path.with_suffix(".options.json")
if len(options) > 0:
if extension == "pyi":
options["source_type"] = "Stub"
with options_path.open("w") as options_file:
json.dump(options, options_file)
elif os.path.exists(options_path):