def build(self, bug: Bug):
        """
        Instructs the server to build the Docker image associated with a given
        bug.
        """
        r = self.__api.post('bugs/{}/build'.format(bug.name))

        if r.status_code == 204:
            return
        if r.status_code == 200:
            raise Exception("bug already built: {}".format(bug.name))
        # TODO: implement ImageBuildFailed.from_dict
        if r.status_code == 400:
            raise Exception("build failure")
        if r.status_code == 404:
          raise KeyError("no bug found with given name: {}".format(bug.name))

        self.__api.handle_erroneous_response(r)
def build ( self , bug : Bug ) : r = self . __api . post ( 'bugs/{}/build' . format ( bug . name ) ) if r . status_code == 204 : return if r . status_code == 200 : raise Exception ( "bug already built: {}" . format ( bug . name ) ) if r . status_code == 400 : raise Exception ( "build failure" ) if r . status_code == 404 : raise KeyError ( "no bug found with given name: {}" . format ( bug . name ) ) self . __api . handle_erroneous_response ( r )
Instructs the server to build the Docker image associated with a given
        bug.