def test_list_contains(): datastore.persist_band(testband) listofbands = datastore.get_list_of_bands() datastore.delete_band(testband['Name']) if testband['Name'] in listofbands: assert (True) else: assert (False)
def new_warband(): if request.method == 'GET': return render_new_band() if request.method == 'POST': createdband = gamerules.form_to_band(request.form) if gamerules.validate_band(createdband) == False: return render_illegal_band() else: datastore.persist_band(createdband) return render_created_band()
def edit_given_warband(band): loadedband = datastore.get_band(band) if request.method == 'GET': return render_edit_band(loadedband) if request.method == 'POST': createdband = gamerules.form_to_band(request.form) if gamerules.validate_band(createdband): datastore.persist_band(createdband) return render_edit_list(datastore.get_band_list()) else: return render_illegal_band()
def test_if_dict(): datastore.persist_band(testband) gotband = datastore.get_band(testband['Name']) datastore.delete_band(testband['Name']) assert (isinstance(gotband, dict))
def test_if_stored(): datastore.persist_band(testband) gotband = datastore.get_band(testband['Name']) datastore.delete_band(testband['Name']) assert (testband == gotband)