Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:14:57

0001 import pytest
0002 
0003 import acts
0004 
0005 import acts.examples
0006 
0007 
0008 def test_navigation_policy_factory():
0009 
0010     policy = (
0011         acts.NavigationPolicyFactory.make()
0012         .add(acts.TryAllNavigationPolicy)
0013         .add(
0014             acts.SurfaceArrayNavigationPolicy,
0015             acts.SurfaceArrayNavigationPolicy.Config(
0016                 layerType=acts.SurfaceArrayNavigationPolicy.LayerType.Disc,
0017                 bins=(10, 10),
0018             ),
0019         )
0020     )
0021 
0022     policy._buildTest()
0023 
0024     policy = acts.NavigationPolicyFactory.make().add(acts.TryAllNavigationPolicy)
0025 
0026     policy._buildTest()
0027 
0028 
0029 def test_navigation_policy_factory_build_empty():
0030     policy = acts.NavigationPolicyFactory.make()
0031 
0032     with pytest.raises(RuntimeError):
0033         policy._buildTest()
0034 
0035 
0036 def test_navigation_policy_factory_add_multiple():
0037     with pytest.raises(ValueError):
0038         (
0039             acts.NavigationPolicyFactory.make()
0040             .add(acts.TryAllNavigationPolicy)
0041             .add(acts.TryAllNavigationPolicy)
0042         )
0043 
0044 
0045 def test_try_all_arguments():
0046     acts.NavigationPolicyFactory.make().add(
0047         acts.TryAllNavigationPolicy, acts.TryAllNavigationPolicy.Config(sensitives=True)
0048     )