'Check if the datetime object contains the same time value
in microseconds.
If sTime is type int or type long, then only convert dTime to
microseconds. Else, convert both dTime and sTime to
microseconds. Then, compare the two after casting them to
long.'

def check_time(self, dTime, sTime):

    t = (mktime(dTime.timetuple()) + (1e-06 * dTime.microsecond))
    if isinstance(sTime, (int, long)):
        self.assertEqual(long((t * 1000)), sTime)
    else:
        t1 = (mktime(sTime.timetuple()) + (1e-06 * sTime.microsecond))
        self.assertEqual(long((t * 1000)), long((t1 * 1000)))
