Loading cog/actions.py +1 −1 Original line number Diff line number Diff line Loading @@ -822,7 +822,7 @@ class Fort(Action): states = cogdb.query.fort_get_systems_by_state(self.session) total = len(cogdb.query.fort_get_systems(self.session, ignore_skips=False)) keys = ['cancelled', 'fortified', 'undermined', 'skipped', 'left'] keys = ['cancelled', 'fortified', 'undermined', 'skipped', 'left', 'almost_done'] lines = [ [key.capitalize() for key in keys], ['{}/{}'.format(len(states[key]), total) for key in keys], Loading cogdb/query.py +4 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ from cogdb.schema import (DiscordUser, FortSystem, FortPrep, FortDrop, FortUser, OCRPrep, Global) from cogdb.scanners import FortScanner DEFER_MISSING = get_config("limits", "defer_missing", default=750) DEFER_MISSING = get_config("limits", "defer_missing", default=650) MAX_DROP = get_config("limits", "max_drop", default=1000) Loading Loading @@ -286,6 +286,7 @@ def fort_get_systems_by_state(session): 'left': [], 'undermined': [], 'skipped': [], 'almost_done': [], } for system in fort_get_systems(session, ignore_skips=False): Loading @@ -300,6 +301,8 @@ def fort_get_systems_by_state(session): states['left'].append(system) if system.skip: states['skipped'].append(system) if system.missing > 0 and system.missing <= DEFER_MISSING: states['almost_done'].append(system) return states Loading tests/cog/test_actions.py +4 −3 Original line number Diff line number Diff line Loading @@ -485,9 +485,10 @@ async def test_cmd_fort_summary(f_bot, f_dusers, f_fort_testbed): await action_map(msg, f_bot).execute() expect = """```Cancelled|Fortified|Undermined|Skipped|Left ---------|---------|----------|-------|---- 0/10 |1/10 |2/10 |2/10 |7/10```""" expect = """```Cancelled|Fortified|Undermined|Skipped|Left|Almost_done ---------|---------|----------|-------|----|----------- 0/10 |1/10 |2/10 |2/10 |7/10|1/10```""" f_bot.send_message.assert_called_with(msg.channel, expect) Loading tests/cogdb/test_query.py +1 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ def test_fort_get_systems_by_state(session, f_dusers, f_fort_testbed): assert [sys.name for sys in systems['undermined']] == [ "Nurundere", "Alpha Fornacis", 'WW Piscis Austrini', 'LPM 229'] assert [sys.name for sys in systems['skipped']] == ['Sol', 'Phra Mool'] assert [sys.name for sys in systems['almost_done']] == ['Dongkum'] def test_fort_find_current_index(session, f_dusers, f_fort_testbed): Loading Loading
cog/actions.py +1 −1 Original line number Diff line number Diff line Loading @@ -822,7 +822,7 @@ class Fort(Action): states = cogdb.query.fort_get_systems_by_state(self.session) total = len(cogdb.query.fort_get_systems(self.session, ignore_skips=False)) keys = ['cancelled', 'fortified', 'undermined', 'skipped', 'left'] keys = ['cancelled', 'fortified', 'undermined', 'skipped', 'left', 'almost_done'] lines = [ [key.capitalize() for key in keys], ['{}/{}'.format(len(states[key]), total) for key in keys], Loading
cogdb/query.py +4 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ from cogdb.schema import (DiscordUser, FortSystem, FortPrep, FortDrop, FortUser, OCRPrep, Global) from cogdb.scanners import FortScanner DEFER_MISSING = get_config("limits", "defer_missing", default=750) DEFER_MISSING = get_config("limits", "defer_missing", default=650) MAX_DROP = get_config("limits", "max_drop", default=1000) Loading Loading @@ -286,6 +286,7 @@ def fort_get_systems_by_state(session): 'left': [], 'undermined': [], 'skipped': [], 'almost_done': [], } for system in fort_get_systems(session, ignore_skips=False): Loading @@ -300,6 +301,8 @@ def fort_get_systems_by_state(session): states['left'].append(system) if system.skip: states['skipped'].append(system) if system.missing > 0 and system.missing <= DEFER_MISSING: states['almost_done'].append(system) return states Loading
tests/cog/test_actions.py +4 −3 Original line number Diff line number Diff line Loading @@ -485,9 +485,10 @@ async def test_cmd_fort_summary(f_bot, f_dusers, f_fort_testbed): await action_map(msg, f_bot).execute() expect = """```Cancelled|Fortified|Undermined|Skipped|Left ---------|---------|----------|-------|---- 0/10 |1/10 |2/10 |2/10 |7/10```""" expect = """```Cancelled|Fortified|Undermined|Skipped|Left|Almost_done ---------|---------|----------|-------|----|----------- 0/10 |1/10 |2/10 |2/10 |7/10|1/10```""" f_bot.send_message.assert_called_with(msg.channel, expect) Loading
tests/cogdb/test_query.py +1 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ def test_fort_get_systems_by_state(session, f_dusers, f_fort_testbed): assert [sys.name for sys in systems['undermined']] == [ "Nurundere", "Alpha Fornacis", 'WW Piscis Austrini', 'LPM 229'] assert [sys.name for sys in systems['skipped']] == ['Sol', 'Phra Mool'] assert [sys.name for sys in systems['almost_done']] == ['Dongkum'] def test_fort_find_current_index(session, f_dusers, f_fort_testbed): Loading