def test_fun(self): # time_cds_short tcds = np.array([(1, 2)], dtype=np.dtype(time_cds_short)) expected = datetime(1958, 1, 2, 0, 0, 0, 2000) self.assertEqual(timecds2datetime(tcds), expected) # time_cds tcds = np.array([(1, 2, 3)], dtype=np.dtype(time_cds)) expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected) # time_cds_expanded tcds = np.array([(1, 2, 3, 4)], dtype=np.dtype(time_cds_expanded)) expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected)
def test_fun(self): """Test function for TestMakeTimeCdsRecarray.""" # time_cds_short tcds = np.array([(1, 2)], dtype=np.dtype(time_cds_short)) expected = datetime(1958, 1, 2, 0, 0, 0, 2000) self.assertEqual(timecds2datetime(tcds), expected) # time_cds tcds = np.array([(1, 2, 3)], dtype=np.dtype(time_cds)) expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected) # time_cds_expanded tcds = np.array([(1, 2, 3, 4)], dtype=np.dtype(time_cds_expanded)) expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected)
def test_fun(self): """Test function for TestMakeTimeCdsDictionary.""" # time_cds_short tcds = {'Days': 1, 'Milliseconds': 2} expected = datetime(1958, 1, 2, 0, 0, 0, 2000) self.assertEqual(timecds2datetime(tcds), expected) # time_cds tcds = {'Days': 1, 'Milliseconds': 2, 'Microseconds': 3} expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected) # time_cds_expanded tcds = {'Days': 1, 'Milliseconds': 2, 'Microseconds': 3, 'Nanoseconds': 4} expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected)
def test_fun(self): # time_cds_short tcds = np.array([(1, 2)], dtype=np.dtype(time_cds_short)) expected = datetime(1958, 1, 2, 0, 0, 0, 2000) self.assertEqual(timecds2datetime(tcds), expected) # time_cds tcds = np.array([(1, 2, 3)], dtype=np.dtype(time_cds)) expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected) # time_cds_expanded tcds = np.array([(1, 2, 3, 4)], dtype=np.dtype(time_cds_expanded)) expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected)
def test_fun(self): # time_cds_short tcds = {'Days': 1, 'Milliseconds': 2} expected = datetime(1958, 1, 2, 0, 0, 0, 2000) self.assertEqual(timecds2datetime(tcds), expected) # time_cds tcds = {'Days': 1, 'Milliseconds': 2, 'Microseconds': 3} expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected) # time_cds_expanded tcds = {'Days': 1, 'Milliseconds': 2, 'Microseconds': 3, 'Nanoseconds': 4} expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected)
def test_fun(self): # time_cds_short tcds = {'Days': 1, 'Milliseconds': 2} expected = datetime(1958, 1, 2, 0, 0, 0, 2000) self.assertEqual(timecds2datetime(tcds), expected) # time_cds tcds = {'Days': 1, 'Milliseconds': 2, 'Microseconds': 3} expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected) # time_cds_expanded tcds = { 'Days': 1, 'Milliseconds': 2, 'Microseconds': 3, 'Nanoseconds': 4 } expected = datetime(1958, 1, 2, 0, 0, 0, 2003) self.assertEqual(timecds2datetime(tcds), expected)