Example #1
0
    def test_time_only(self):
        result = format_utils.format_time_range(self.BEGIN_TS, self.END_TS)
        result_gmt = format_utils.format_time_range(self.BEGIN_TS,
                                                    self.END_TS,
                                                    gmt=True)

        self.assertEqual(result, '[16:57:08.123456789, 17:57:08.123456789]')
        self.assertEqual(result_gmt,
                         '[20:57:08.123456789, 21:57:08.123456789]')
    def test_time_only(self):
        result = format_utils.format_time_range(
            self.BEGIN_TS, self.END_TS
        )
        result_gmt = format_utils.format_time_range(
            self.BEGIN_TS, self.END_TS, gmt=True
        )

        self.assertEqual(result,
                         '[16:57:08.123456789, 17:57:08.123456789]')
        self.assertEqual(result_gmt,
                         '[20:57:08.123456789, 21:57:08.123456789]')
Example #3
0
    def test_print_date(self):
        result = format_utils.format_time_range(self.BEGIN_TS,
                                                self.END_TS,
                                                print_date=True)
        result_gmt = format_utils.format_time_range(self.BEGIN_TS,
                                                    self.END_TS,
                                                    print_date=True,
                                                    gmt=True)

        self.assertEqual(
            result,
            '[1991-08-25 16:57:08.123456789, 1991-08-25 17:57:08.123456789]')
        self.assertEqual(
            result_gmt,
            '[1991-08-25 20:57:08.123456789, 1991-08-25 21:57:08.123456789]')
    def test_print_date(self):
        result = format_utils.format_time_range(
            self.BEGIN_TS, self.END_TS, print_date=True
        )
        result_gmt = format_utils.format_time_range(
            self.BEGIN_TS, self.END_TS, print_date=True, gmt=True
        )

        self.assertEqual(
            result,
            '[1991-08-25 16:57:08.123456789, 1991-08-25 17:57:08.123456789]'
        )
        self.assertEqual(
            result_gmt,
            '[1991-08-25 20:57:08.123456789, 1991-08-25 21:57:08.123456789]'
        )