~cjwatson/launchpad-buildd/extended-snap-status

« back to all changes in this revision

Viewing changes to lpbuildd/tests/test_snap.py

  • Committer: Colin Watson
  • Date: 2017-04-03 12:30:15 UTC
  • Revision ID: cjwatson@canonical.com-20170403123015-18our0f4alofcjs0
Record the branch revision used to build a snap and return it along with
other XML-RPC status information (LP: #1679157).

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
            self.buildmanager.iterate, self.buildmanager.iterators[-1])
83
83
        self.assertFalse(self.slave.wasCalled("chrootFail"))
84
84
 
 
85
    def test_status(self):
 
86
        # The build manager returns saved status information on request.
 
87
        self.assertEqual({}, self.buildmanager.status())
 
88
        status_path = os.path.join(
 
89
            self.working_dir, "home", "build-%s" % self.buildid, "status")
 
90
        os.makedirs(os.path.dirname(status_path))
 
91
        with open(status_path, "w") as status_file:
 
92
            status_file.write('{"revision_id": "dummy"}')
 
93
        self.assertEqual({"revision_id": "dummy"}, self.buildmanager.status())
 
94
 
85
95
    def test_iterate(self):
86
96
        # The build manager iterates a normal build from start to finish.
87
97
        self.startBuild()