Beispiel #1
0
    def test_format_time(self):
        self.assertEqual(formatTime(None), '')
        self.assertEqual(formatTime(''), '')

        desired = '2017-10-05 09:52:31'
        # datetime
        d = datetime.datetime(year=2017,
                              month=10,
                              day=5,
                              hour=9,
                              minute=52,
                              second=31,
                              microsecond=12)
        self.assertEqual(formatTime(d), desired)

        # DateTime
        d1 = xmlrpc_client.DateTime(d)
        self.assertEqual(formatTime(d1), desired)

        # str
        self.assertEqual(formatTime(desired), desired)

        # str + microseconds
        self.assertEqual(formatTime(desired + '.123'), desired)
Beispiel #2
0
def _changelogDate(cldate):
    return time.strftime(
        '%a %b %d %Y',
        time.strptime(koji.formatTime(cldate), '%Y-%m-%d %H:%M:%S'))
Beispiel #3
0
def _changelogDate(cldate):
    return time.strftime("%a %b %d %Y", time.strptime(koji.formatTime(cldate), "%Y-%m-%d %H:%M:%S"))
Beispiel #4
0
def _changelogDate(cldate):
    return time.strftime('%a %b %d %Y', time.strptime(koji.formatTime(cldate), '%Y-%m-%d %H:%M:%S'))