~canonical-launchpad-branches/launchpad-buildd/trunk

« back to all changes in this revision

Viewing changes to lpbuildd/tests/test_snap.py

  • Committer: Colin Watson
  • Date: 2017-05-11 08:34:07 UTC
  • mfrom: (215.1.1 extended-snap-status)
  • Revision ID: cjwatson@canonical.com-20170511083407-2jvw6phrd50strdk
[r=wgrant] 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()