~launchpad-results/launchpad-results/trunk

« back to all changes in this revision

Viewing changes to lib/lpresults/scripts/tests/test_option.py

  • Committer: Marc Tardif
  • Date: 2011-09-14 01:25:40 UTC
  • Revision ID: marc.tardif@canonical.com-20110914012540-1gs255vhv6kb0mg4
Added updating of submissions periodically.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
    TestCase,
15
15
    )
16
16
 
17
 
from lpresults.services.option import (
 
17
from lpresults.scripts.option import (
18
18
    check_date,
19
19
    DateOption,
20
20
    )
21
 
from lpresults.services.testing.cases import ApplicationTestCase
 
21
from lpresults.scripts.testing.cases import ApplicationTestCase
22
22
 
23
23
 
24
24
class TestCheckDate(TestCase):
25
25
 
26
26
    def test_valid(self):
27
 
        check_date(None, "-d", "2010/01/01")
 
27
        check_date(None, "-d", "2010-01-01")
28
28
 
29
29
    def test_invalid(self):
30
30
        self.assertRaises(
31
 
            OptionValueError, check_date, None, "-d", "2010-01-01")
 
31
            OptionValueError, check_date, None, "-d", "2010/01/01")
32
32
        self.assertRaises(
33
33
            OptionValueError, check_date, None, "-d", "20100101")
34
34
 
41
41
        self.parser.add_option("--date", type="date")
42
42
 
43
43
    def test_valid(self):
44
 
        self.parser.parse_args(["--date=2010/01/01"])
 
44
        self.parser.parse_args(["--date=2010-01-01"])
45
45
 
46
46
    def test_invalid(self):
47
47
        self.assertRaises(SystemExit,