Wire production aircraft callbacks and diagnose native prison action selection
This commit is contained in:
@@ -920,4 +920,25 @@ class AlignmentIntegrationTests(unittest.TestCase):
|
||||
stop.assert_called_once();self.assertIsNone(failed.call_args.args[1])
|
||||
|
||||
|
||||
|
||||
class GateChoicesArguments(unittest.TestCase):
|
||||
def test_exact_gate_choices_are_readonly_and_bound_in_wrapper_and_live_process(self):
|
||||
args=SimpleNamespace(nonce='N',prefix=Path('/tmp/pfx'),profile=Path('/tmp/profile'),game_executable=Path('/tmp/game'),host_display=':0',report=Path('/tmp/input.json'),console=None,enable_private_look_proof=True,enable_private_approach_proof=True,
|
||||
command=[sys.executable,str(Path(proof.display.__file__).resolve()),'placeholder'])
|
||||
prefix=[str(Path.home()/'.local/share/Steam/steamapps/common/Proton - Experimental/proton'),'run',str(args.game_executable),'-errOrdinaryInputObserve','N','-errOrdinaryLookObserve','N','-errOrdinaryScenario','core','-profile','Z:/tmp/profile']
|
||||
gate=['-errOrdinaryGateObserve','N'];choice=['-errOrdinaryGateChoices','N']
|
||||
cases=[(gate,True,True),(gate+choice,True,True),(gate+choice,False,False),(gate,False,True),([],False,True),([],True,False),(choice,True,False),(gate+choice+choice,True,False),(gate+gate,True,False),(gate+['-errOrdinaryGateChoices','foreign'],True,False),(gate+['-errOrdinaryGateChoices'],True,False),(gate+['-errOrdinaryGateChoicesAlias','N'],True,False)]
|
||||
for suffix,approach,allowed in cases:
|
||||
with self.subTest(suffix=suffix,approach=approach):
|
||||
args.enable_private_approach_proof=approach
|
||||
native=prefix+suffix;owner={'pid':123,'process':{'pid':123}}
|
||||
wrapped=SimpleNamespace(query_worker=False,prefix=args.prefix,profile=args.profile,game_executable=args.game_executable,host_display=args.host_display,report=Path('/tmp/display.json'),command=['--']+native)
|
||||
with patch.object(proof.display,'parse_args',return_value=wrapped),patch.object(proof.display,'validate_paths'),patch.object(proof.display,'process',return_value={'args':native}),patch.object(proof.display,'identity',return_value=owner['process']):
|
||||
if allowed:
|
||||
self.assertEqual(proof.wrapper_command(args),args.command)
|
||||
proof.game_arguments(owner,args)
|
||||
else:
|
||||
with self.assertRaises(proof.Refused):proof.wrapper_command(args)
|
||||
with self.assertRaises(proof.Refused):proof.game_arguments(owner,args)
|
||||
|
||||
if __name__ == '__main__': unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user