From 057c74440c0fe347c152bba3b406177396d50b7c Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Mon, 2 Sep 2019 15:01:11 -0400 Subject: [PATCH 1/2] whitespace changes to test on github --- run_tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run_tests.py b/run_tests.py index 81e85fa..40ab00c 100644 --- a/run_tests.py +++ b/run_tests.py @@ -22,8 +22,10 @@ def import_tests(): return tests + def test(): run(tests=import_tests()) + if __name__ == '__main__': test() From e045660ef0b30e80bba0b68a95ba2c10d38d937b Mon Sep 17 00:00:00 2001 From: Edward Burnell Date: Mon, 2 Sep 2019 15:08:36 -0400 Subject: [PATCH 2/2] remove duplicate test --- robust/testing/t_primitives.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/robust/testing/t_primitives.py b/robust/testing/t_primitives.py index e1e5728..f7bd630 100644 --- a/robust/testing/t_primitives.py +++ b/robust/testing/t_primitives.py @@ -9,18 +9,6 @@ from robust.testing.models import sp_test_model, gp_test_model class TestPrimitives(unittest.TestCase): - def test_MarginModel(self): - """ Tests creation and solution of MarginModel""" - m = sp_test_model() - mm = MarginModel(m, gamma = 0.5) - margin_solution = mm.localsolve(verbosity=0) - uncertain_varkeys = [k for k in m.varkeys if RobustGPTools.is_directly_uncertain(k)] - # Checking margin allocation - for key in list(uncertain_varkeys): - assert(mm.substitutions.get(key) == m.substitutions.get(key) * - (1.+mm.setting.get("gamma")*key.pr/100.)) - self.assertGreater(margin_solution['cost'], mm.nominal_cost) - def test_MarginModel(self): """ Tests creation and solution of MarginModel""" m = sp_test_model()