Exemplo n.º 1
0
    def testParseIso8601ToDateTime(self):
        test_values = ({
            'value': '2017-01-02T03:04:05+00:00',
            'expected': datetime(year=2017, month=1, day=2, hour=3, minute=4, second=5),
        }, {
            'value': '2017-01-02T03:04:05-06:00',
            'expected': datetime(year=2017, month=1, day=2, hour=9, minute=4, second=5),
        }, {
            'value': '2017-01-02T03:04:05+06:00',
            'expected': datetime(year=2017, month=1, day=1, hour=21, minute=4, second=5),
        })

        for test_value in test_values:
            self.assertEqual(parse_iso8601_to_date_time(test_value['value']), test_value['expected'])
Exemplo n.º 2
0
    def updateFromRow(self, row):
        self.version.data = row.version
        self.buildNumber.data = row.buildNumber
        self.branch.data = row.branch
        # Revision is a disabled field if relbranch is present, so we shouldn't
        # put any data in it.
        if not row.mozillaRelbranch:
            self.mozillaRevision.data = row.mozillaRevision
        self.l10nChangesets.data = row.l10nChangesets
        self.mozillaRelbranch.data = row.mozillaRelbranch
        self.mh_changeset.data = row.mh_changeset

        if row.release_eta:
            release_eta = parse_iso8601_to_date_time(row.release_eta)
            self.release_eta_date.data = release_eta.date()
            # Conversion needed because release_eta_time is a StringField
            self.release_eta_time.data = release_eta.strftime('%H:%M %Z')
Exemplo n.º 3
0
    def updateFromRow(self, row):
        self.version.data = row.version
        self.buildNumber.data = row.buildNumber
        self.branch.data = row.branch
        # Revision is a disabled field if relbranch is present, so we shouldn't
        # put any data in it.
        if not row.mozillaRelbranch:
            self.mozillaRevision.data = row.mozillaRevision
        self.l10nChangesets.data = row.l10nChangesets
        self.mozillaRelbranch.data = row.mozillaRelbranch
        self.mh_changeset.data = row.mh_changeset

        if row.release_eta:
            release_eta = parse_iso8601_to_date_time(row.release_eta)
            self.release_eta_date.data = release_eta.date()
            # Conversion needed because release_eta_time is a StringField
            self.release_eta_time.data = release_eta.strftime('%H:%M %Z')
    def testParseIso8601ToDateTime(self):
        test_values = ({
            'value':
            '2017-01-02T03:04:05+00:00',
            'expected':
            datetime(year=2017, month=1, day=2, hour=3, minute=4, second=5),
        }, {
            'value':
            '2017-01-02T03:04:05-06:00',
            'expected':
            datetime(year=2017, month=1, day=2, hour=9, minute=4, second=5),
        }, {
            'value':
            '2017-01-02T03:04:05+06:00',
            'expected':
            datetime(year=2017, month=1, day=1, hour=21, minute=4, second=5),
        })

        for test_value in test_values:
            self.assertEqual(parse_iso8601_to_date_time(test_value['value']),
                             test_value['expected'])