def test_normalise_exec_host(self): """ test the conversion of a list containing one or more strings of the form nodenameXYZ/C+nodenameUVW/D+... to nodenameXYZ/A-C,nodenameUVW/D-E,... """ list1 = "node2400/0+node2400/1+node2400/2+node2401/3+node2401/4+node2402/5" expected1 = "node2400/0-2,node2401/3-4,node2402/5" class Job(object): def get_nodes(self): return list1.split("+") job = Job() self.assertEqual(normalise_exec_host(job, None), expected1)
def test_normalise_exec_host(self): """ test the conversion of a list containing one or more strings of the form nodenameXYZ/C+nodenameUVW/D+... to nodenameXYZ/A-C,nodenameUVW/D-E,... """ list1 = "node2400/0+node2400/1+node2400/2+node2401/3+node2401/4+node2402/5" expected1 = "node2400/0-2,node2401/3-4,node2402/5" class Job(object): def get_nodes(self): return list1.split("+") job = Job() # pass non-existing named arg blablah to make sure that possible future argumnets do not cause failures self.assertEqual(normalise_exec_host(job=job, time=None, blablah='future argument'), expected1)
def test_normalise_exec_host(self): """ test the conversion of a list containing one or more strings of the form nodenameXYZ/C+nodenameUVW/D+... to nodenameXYZ/A-C,nodenameUVW/D-E,... """ list1 = "node2400/0+node2400/1+node2400/2+node2401/3+node2401/4+node2402/5" expected1 = "node2400/0-2,node2401/3-4,node2402/5" class Job(object): def get_nodes(self): return list1.split("+") job = Job() # pass non-existing named arg blablah to make sure that possible future argumnets do not cause failures self.assertEqual( normalise_exec_host(job=job, time=None, blablah='future argument'), expected1)