def test_format(self):
            '''
            Take duration/timedelta object and create ISO string from it.
            This is the reverse test to test_parse.
            '''
            if altstr:
                self.assertEqual(duration_isoformat(expectation, format),
                                 altstr)
            else:
                # if durationstring == '-P2W':
                #     import pdb; pdb.set_trace()
                self.assertEqual(duration_isoformat(expectation, format),
                                 durationstring)

            Take duration/timedelta object and create ISO string from it.
            This is the reverse test to test_parse.
            
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/isodate/tests/test_duration.py