Skip to content

Commit

Permalink
renaming and expanding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Allen committed Dec 13, 2023
1 parent 95dfba0 commit 9f96d35
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- updating test file names and adding additional scenarios to the test files (e.g. `test_lbg1_lg0_i2.py` -> `test_lbg1_i2.py` so we can test lg1_i2 and lg2_i2 in the same file)
- Updating print statements to logger statements in pe1 e3_envs

### Removed
Expand Down
1 change: 0 additions & 1 deletion src/kspdg/lbg1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ See `Group1BaseEnv.vessel_step()` in [`base_envs.py`](https://github.com/mit-ll/
+ ID `lg0`: Lady and Guard are passive, no maneuvering
+ ID `lg1`: Lady is passive, Guard applies heuristic pursuit of Bandit using target-zero_vel-target relative maneuver sequence
+ ID `lg2`: Lady applies hueristic evasive maneuvers of Bandit using out-of-plane burns in order to maintian constant period of orbit, Guard applies heuristic pursuit of Bandit using target-zero_vel-target relative maneuver sequence
+ _NotImplemented_
+ ID `lgnash1`: Lady is passive, Nash-equliibrium/optimal pursuit maneuvers for Guard
+ _NotImplemented_
+ ID `lgnash2`: Nash-equliibrium/optimal pursuit maneuvers for Lady and Guard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,43 @@

import kspdg.utils.constants as C
from kspdg.lbg1.lg0_envs import LBG1_LG0_I2_Env
from kspdg.lbg1.lg1_envs import LBG1_LG1_I2_Env
from kspdg.lbg1.lg2_envs import LBG1_LG2_I2_Env

@pytest.fixture
def lbg1_lg0_i2_env():
"""setup and teardown of the PursuitEnvV20220516 object connected to kRPC server"""
"""setup and teardown of the LBG1_LG0_I2_Env object connected to kRPC server"""
env = LBG1_LG0_I2_Env()
env.reset()
yield env
env.close()

def test_smoketest_0(lbg1_lg0_i2_env):
"""Simply ensure no errors are thrown from starting environment"""
@pytest.fixture
def lbg1_lg1_i2_env():
"""setup and teardown of the LBG1_LG1_I2_Env object connected to kRPC server"""
env = LBG1_LG1_I2_Env()
env.reset()
yield env
env.close()

@pytest.fixture
def lbg1_lg2_i2_env():
"""setup and teardown of the LBG1_LG2_I2_Env object connected to kRPC server"""
env = LBG1_LG2_I2_Env()
env.reset()
yield env
env.close()

def test_smoketest_lg0(lbg1_lg0_i2_env):
"""Ensure no errors are thrown from starting LG0 environment"""
pass

def test_smoketest_lg0(lbg1_lg1_i2_env):
"""Ensure no errors are thrown from starting LG1 environment"""
pass

def test_smoketest_lg0(lbg1_lg1_i2_env):
"""Ensure no errors are thrown from starting LG2 environment"""
pass

def test_observation_0(lbg1_lg0_i2_env):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

import kspdg.utils.constants as C
from kspdg.pe1.e1_envs import PE1_E1_I3_Env
from kspdg.pe1.e2_envs import PE1_E2_I3_Env
from kspdg.pe1.e3_envs import PE1_E3_I3_Env
from kspdg.pe1.e4_envs import PE1_E4_I3_Env

@pytest.fixture
def pe1_e1_i3_env():
Expand All @@ -23,6 +26,46 @@ def pe1_e1_i3_env():
yield env
env.close()

@pytest.fixture
def pe1_e2_i3_env():
'''setup and teardown of the pursuit-evade env object connected to kRPC server'''
env = PE1_E2_I3_Env()
env.reset()
yield env
env.close()

@pytest.fixture
def pe1_e3_i3_env():
'''setup and teardown of the pursuit-evade env object connected to kRPC server'''
env = PE1_E3_I3_Env()
env.reset()
yield env
env.close()

@pytest.fixture
def pe1_e4_i3_env():
'''setup and teardown of the pursuit-evade env object connected to kRPC server'''
env = PE1_E4_I3_Env()
env.reset()
yield env
env.close()

def test_smoketest_e1(pe1_e1_i3_env):
"""Ensure no errors are thrown from starting E1 environment"""
pass

def test_smoketest_e2(pe1_e2_i3_env):
"""Ensure no errors are thrown from starting E2 environment"""
pass

def test_smoketest_e3(pe1_e3_i3_env):
"""Ensure no errors are thrown from starting E3 environment"""
pass

def test_smoketest_e4(pe1_e4_i3_env):
"""Ensure no errors are thrown from starting E4 environment"""
pass

def test_observation_dict_list_convert_0(pe1_e1_i3_env):
'''check that converting between lists and dict to not alter observation'''
# ~~ ARRANGE ~~
Expand Down
File renamed without changes.

0 comments on commit 9f96d35

Please sign in to comment.