mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Python refactoring
- Optimize imports - Adjust coding style to PEP8 - Remove obsolete comments
This commit is contained in:
parent
311c8c2c83
commit
dd42f844c6
28 changed files with 74 additions and 467 deletions
|
@ -26,30 +26,17 @@
|
|||
#
|
||||
###############################################################################
|
||||
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
# Ensure python finds the local simpletap module
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from basetest import Timew, TestCase
|
||||
|
||||
# Test methods available:
|
||||
# self.assertEqual(a, b)
|
||||
# self.assertNotEqual(a, b)
|
||||
# self.assertTrue(x)
|
||||
# self.assertFalse(x)
|
||||
# self.assertIs(a, b)
|
||||
# self.assertIsNot(substring, text)
|
||||
# self.assertIsNone(x)
|
||||
# self.assertIsNotNone(x)
|
||||
# self.assertIn(substring, text)
|
||||
# self.assertNotIn(substring, text
|
||||
# self.assertRaises(e)
|
||||
# self.assertRegexpMatches(text, pattern)
|
||||
# self.assertNotRegexpMatches(text, pattern)
|
||||
# self.tap("")
|
||||
|
||||
class TestShorten(TestCase):
|
||||
def setUp(self):
|
||||
|
@ -140,6 +127,7 @@ class TestBug6(TestCase):
|
|||
code, out, err = self.t.runError("shorten @1 10mins")
|
||||
self.assertIn('Cannot shorten interval @1 by 0:10:00 because it is only 0:05:00 in length.', err)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue