def test_opt_template(self): opt_params = OrderedDict({ "CONSTRAINT": ["tors 2 3 4 5 25.0", "bend 2 1 4 110.0"], "FIXED": ["x y 2 4 5"], "DUMMY": ["M 2 3 4 5"], "CONNECT": ["4 3 2 3 5 6"] }) opt_test = QCInput.opt_template(opt_params) opt_actual = """$opt CONSTRAINT tors 2 3 4 5 25.0 bend 2 1 4 110.0 ENDCONSTRAINT FIXED x y 2 4 5 ENDFIXED DUMMY M 2 3 4 5 ENDDUMMY CONNECT 4 3 2 3 5 6 ENDCONNECT $end""" self.assertEqual(opt_actual, opt_test)
def test_opt_template(self): opt_params = { "CONSTRAINT": ["tors 2 3 4 5 25.0", "bend 2 1 4 110.0"], "FIXED": ["x y 2 4 5"], "DUMMY": ["M 2 3 4 5"], "CONNECT": ["4 3 2 3 5 6"] } opt_test = QCInput.opt_template(opt_params).split("\n") opt_actual_list = ["$opt", "CONSTRAINT", " tors 2 3 4 5 25.0", " bend 2 1 4 110.0", "ENDCONSTRAINT", "FIXED", " x y 2 4 5", "ENDFIXED", "DUMMY", " M 2 3 4 5", "ENDDUMMY", "CONNECT", " 4 3 2 3 5 6", "ENDCONNECT", "$end"] for i_opt in opt_actual_list: self.assertIn(i_opt, opt_test)
def test_opt_template(self): opt_params = { "CONSTRAINT": ["tors 2 3 4 5 25.0", "bend 2 1 4 110.0"], "FIXED": ["x y 2 4 5"], "DUMMY": ["M 2 3 4 5"], "CONNECT": ["4 3 2 3 5 6"] } opt_test = QCInput.opt_template(opt_params).split("\n") opt_actual_list = [ "$opt", "CONSTRAINT", " tors 2 3 4 5 25.0", " bend 2 1 4 110.0", "ENDCONSTRAINT", "FIXED", " x y 2 4 5", "ENDFIXED", "DUMMY", " M 2 3 4 5", "ENDDUMMY", "CONNECT", " 4 3 2 3 5 6", "ENDCONNECT", "$end" ] for i_opt in opt_actual_list: self.assertIn(i_opt, opt_test)