コード例 #1
0
    def test_standard(self):

        global TO

        test_stamp = 41640.14775462963
        actual = nrcSpreadsheetScraper.timestamp2datetime(test_stamp, 0)
        expected = "2014-01-01 03:32:46"
        self.assertEqual(expected, actual)
コード例 #2
0
    def test_incident_datetime(self):

        # Assemble the required arguments
        # These arguments contain the bare minimum requirements needed to test the function
        class _workbook(object):
            datemode = 0

        workbook = _workbook()
        map_def = {"column": "DATE"}
        row = {"DATE": 41640.14775462963}

        expected = nrcSpreadsheetScraper.timestamp2datetime(row["DATE"], workbook.datemode)
        actual = nrcSpreadsheetScraper.NrcScrapedReportFields.recieved_datetime(
            row=row, map_def=map_def, workbook=workbook
        )
        self.assertEqual(expected, actual)