Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: infra/libs/git2/data/test/commit_test.py

Issue 355153002: Refactor infra git libs and testing. (Closed) Base URL: https://chromium.googlesource.com/infra/infra@fake_testing_support
Patch Set: Change config ref to have a sandard naming scheme Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 import textwrap 6 import textwrap
7 import unittest 7 import unittest
8 8
9 from infra.services.gnumbd.support import data 9 from infra.libs.git2 import data
10 10
11 class TestCommitTimestamp(unittest.TestCase): 11 class TestCommitTimestamp(unittest.TestCase):
12 def testBasic(self): 12 def testBasic(self):
13 TS = '1399330903 -0700' 13 TS = '1399330903 -0700'
14 t = data.CommitTimestamp.from_raw(TS) 14 t = data.CommitTimestamp.from_raw(TS)
15 self.assertEqual(1399330903, t.secs) 15 self.assertEqual(1399330903, t.secs)
16 self.assertEqual(7, t.hours) 16 self.assertEqual(7, t.hours)
17 self.assertEqual(0, t.mins) 17 self.assertEqual(0, t.mins)
18 self.assertEqual('-', t.sign) 18 self.assertEqual('-', t.sign)
19 self.assertEqual('-0700', t.tz_str) 19 self.assertEqual('-0700', t.tz_str)
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 def testPartial(self): 433 def testPartial(self):
434 COMMIT = textwrap.dedent("""\ 434 COMMIT = textwrap.dedent("""\
435 tree deadbeefdeadbeefdeadbeefdeadbeefdeadbeef 435 tree deadbeefdeadbeefdeadbeefdeadbeefdeadbeef
436 """) 436 """)
437 with self.assertRaises(data.PartialCommit): 437 with self.assertRaises(data.PartialCommit):
438 data.CommitData.from_raw(COMMIT) 438 data.CommitData.from_raw(COMMIT)
439 439
440 def testEmpty(self): 440 def testEmpty(self):
441 with self.assertRaises(data.PartialCommit): 441 with self.assertRaises(data.PartialCommit):
442 data.CommitData.from_raw('') 442 data.CommitData.from_raw('')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698