~cjwatson/isitdeployable/version-no-cache

« back to all changes in this revision

Viewing changes to revtracker/tests/test_tasks.py

  • Committer: Ubuntu One Auto Copilot
  • Author(s): Colin Watson
  • Date: 2018-03-01 17:58:42 UTC
  • mfrom: (278.1.1 improve-codetree-parsing)
  • Revision ID: otto-copilot@canonical.com-20180301175842-1vrijp9t3elnu42d
Improve sourcedep parsing to handle multiple options.

Merged from https://code.launchpad.net/~cjwatson/isitdeployable/improve-codetree-parsing/+merge/340239

Show diffs side-by-side

added added

removed removed

Lines of Context:
371
371
            branch.unlock()
372
372
 
373
373
 
 
374
class ParseSourcedepsLineTests(TestCase):
 
375
 
 
376
    def test_empty(self):
 
377
        self.assertEqual((None, None, None), tasks.parse_sourcedeps_line(""))
 
378
 
 
379
    def test_comment(self):
 
380
        self.assertEqual(
 
381
            (None, None, None), tasks.parse_sourcedeps_line("# comment"))
 
382
 
 
383
    def test_no_options(self):
 
384
        self.assertEqual(
 
385
            ("foo", "lp:foo", None),
 
386
            tasks.parse_sourcedeps_line("foo lp:foo"))
 
387
 
 
388
    def test_revno(self):
 
389
        self.assertEqual(
 
390
            ("foo", "lp:foo", "100"),
 
391
            tasks.parse_sourcedeps_line("foo lp:foo;revno=100"))
 
392
 
 
393
    def test_multiple_options(self):
 
394
        self.assertEqual(
 
395
            ("foo", "lp:foo", "100"),
 
396
            tasks.parse_sourcedeps_line(
 
397
                "foo lp:foo;revno=100,overwrite=true"))
 
398
 
 
399
 
374
400
class FixupBranchLocationTests(TestCase):
375
401
 
376
402
    def test_lp_scheme(self):