From 00ddf828fc08d597c2a12f87a30095f92f9c10d2 Mon Sep 17 00:00:00 2001 From: Henrique Pereira Date: Tue, 22 Apr 2014 14:35:55 -0300 Subject: [PATCH] PEP8 PEP8 --- tests/time_test.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tests/time_test.py b/tests/time_test.py index 89db1f6..e26b7fc 100644 --- a/tests/time_test.py +++ b/tests/time_test.py @@ -11,6 +11,7 @@ class InitTimeTestCase(TestCase): + def test_direct(self): d = Time(2014, 4, 18, 17, 50, 21) @@ -100,7 +101,8 @@ def test_str_tz(self): assert_equal(t.second, 21) def test_str_specify_tz(self): - t = Time.from_str("2014-04-18T17:50:21.036391", tz='America/Los_Angeles') + t = Time.from_str( + "2014-04-18T17:50:21.036391", tz='America/Los_Angeles') assert_equal(t.year, 2014) assert_equal(t.month, 4) @@ -111,6 +113,7 @@ def test_str_specify_tz(self): class ConvertTimeTestCase(TestCase): + @setup def create_time(self): self.t = Time(2014, 4, 18, 17, 50, 21, 36391) @@ -119,14 +122,16 @@ def test_str(self): assert_equal(self.t.to_str(), "2014-04-18T17:50:21.036391+00:00") def test_str_tz(self): - assert_equal(self.t.to_str(tz='America/Los_Angeles'), "2014-04-18T10:50:21.036391-07:00") + assert_equal( + self.t.to_str(tz='America/Los_Angeles'), "2014-04-18T10:50:21.036391-07:00") def test_str_local(self): # We don't really konw assert self.t.to_str(local=True) def test_str_format(self): - assert_equal(self.t.to_str(format="%m/%d/%Y %H:%M"), "04/18/2014 17:50") + assert_equal( + self.t.to_str(format="%m/%d/%Y %H:%M"), "04/18/2014 17:50") def test_timestamp(self): assert_equal(self.t.to_timestamp(), 1397872221.036391) @@ -168,6 +173,7 @@ def test_human(self): class ArithmeticTimeTest(TestCase): + def test_time_add(self): t1 = Time(2014, 4, 18, 17, 50, 21) ti = TimeInterval(2.22) @@ -188,6 +194,7 @@ def test_time_sub(self): class InitTimeIntervalTest(TestCase): + def test_seconds(self): i = TimeInterval(21) @@ -222,6 +229,7 @@ def test_microsecond_overflow(self): class ConvertTimeIntervalTest(TestCase): + def test_int(self): i = TimeInterval(4) assert_equal(int(i), 4) @@ -240,6 +248,7 @@ def test_str(self): class ArithmeticTimeIntervalTest(TestCase): + def test_add(self): i1 = TimeInterval(1) i2 = TimeInterval(1) @@ -328,6 +337,7 @@ def test_cmp(self): class TimeSpanTest(TestCase): + def test_iter(self): t1 = Time.now() t2 = Time.now() + 30 @@ -350,9 +360,10 @@ def test_get(self): class TimeIteratorTest(TestCase): + def test(self): start_t = Time.now() - end_t = start_t + 5*60 + end_t = start_t + 5 * 60 times = list(TimeIterator(TimeSpan(start_t, end_t), TimeInterval(60))) assert_equal(len(times), 6) @@ -361,11 +372,13 @@ def test(self): class TimeSpanIteratorTest(TestCase): + def test(self): start_t = Time.now() - end_t = start_t + 5*60 + end_t = start_t + 5 * 60 - times = list(TimeSpanIterator(TimeSpan(start_t, end_t), TimeInterval(60))) + times = list( + TimeSpanIterator(TimeSpan(start_t, end_t), TimeInterval(60))) assert_equal(len(times), 5) assert_equal(times[0].start, start_t) assert_equal(times[-1].end, end_t)