def pickAFunc(): if (databaseNeeds.connection()): True else: sys.exit() funcOption = input('Pick a function' + '\n1 - Shortest Distance' + '\n2 - Retirement' '\n0 - Exit\n') if (funcOption == 1): #Prints Previous Data Stored Locally x = {"_id": 0, "x1": 1, "x2": 1, 'y1': 1, "y2": 1, "timestamp": 1} databaseNeeds.printData(x) getX1 = input('Please enter your x1 value\n') getY1 = input('Please enter your y1 value\n') getX2 = input('Please enter your x2 value\n') getY2 = input('Please enter your y2 value\n') shortestDistance(getX1, getY1, getX2, getY2) pickAFunc() elif (funcOption == 2): # Prints Previous Data Stored Locally x = { "_id": 0, "age": 1, "annualSalary": 1, 'percentSaved': 1, "retirementSaveGoal": 1 } databaseNeeds.printData(x) age = input("How old are you?") annualSalary = input("what is your annual Salary") percentSaved = input("what percentage saved") retirementSaveGoal = input("what is your retirement saving goal?") retirement(age, annualSalary, percentSaved, retirementSaveGoal) pickAFunc() elif (funcOption == '0'): sys.exit() else: pickAFunc()
def test_Mock_Connection(self): self.assertFalse(databaseNeeds.connection("gg"))
def test_Mock_Connection(self): self.assertFalse(databaseNeeds.connection("mongodb://localhost:270/"))
def store_data(self): self.assertFalse(databaseNeeds.connection({})) return False
def open_connection(self): self.assertFalse(databaseNeeds.connection("gg")) return True