def do_remove(self, arguments): """remove a remote module repository""" if len(arguments.options) == 1: url = arguments.options[0] try: Remote.delete(url) print "Removed remove %s.\n" % url except UnknownRemote: print "The target (%s) is not a remote module repository.\n" % url else: print "usage: drozer module remote delete http://path.to.repository/\n"
def testItShouldNotRemoteARemoteTheDoesNotExist(self): Configuration._Configuration__config = self.mockConfigWithRemotes([]) try: assert Remote.delete("http://myremote.com/") assert False, "expected UnknownRemote" except UnknownRemote: pass
def testItShouldRemoveARemote(self): Configuration._Configuration__config = self.mockConfigWithRemotes( ["http://myremote.com/"]) assert Remote.delete("http://myremote.com/") assert Remote.all() == []