def ask_payment_data_questions(self):
        self.QuestionInputValidation = framework.QuestionInputValidation()
        '''
		METHOD WILL ASK ALL QUESTIONS FOR PAYMENT DATA ENTRY
		'''
        self.continue_asking_payment_data_questions = "yes"
        self.valid = "Y"
        while self.continue_asking_payment_data_questions.lower(
        ) == "y" or self.continue_asking_payment_data_questions.lower(
        ) == "yes":
            self.dict_of_answers = {
                'unit_number': '',
                'due_date': '',
                'date_collected': '',
                'amount_due': '',
                'amount_collected': ''
            }
            self.ask_unit_number()
            self.ask_due_date()
            self.ask_date_collected()
            self.ask_amount_due()
            self.ask_amount_collected()

            if self.valid == 'Y':
                self.final_payment_list.append(self.dict_of_answers)

            self.ask_continue_question_for_payments()
Exemple #2
0
 def __init__(self):
     self.final_work_order_list = []
     self.QuestionInputValidation = framework.QuestionInputValidation()
Exemple #3
0
import pytest  #YOU MUST INSTALL PYTEST ON SYSTEM FOR THIS TO WORK
#pip install pytest

framework.WorkOrdersSetup()  #FRAMEWORK
mediator = utilities.ConcreteMediator()

mediator.dbHandler.query('''CREATE TABLE IF NOT EXISTS workOrders(
workOrderID INTEGER PRIMARY KEY, 
entry_date TEXT default CURRENT_DATETIME, 
unitNumber INTEGER, 
type TEXT, 
issue TEXT)''')  #NEED TO ENSURE THIS TABLE IS THERE
framework.PaymentsSetup()  #FRAMEWORK

QuestionInputValidation = framework.QuestionInputValidation()


###########--------------UTILITIES TESTS-----------------###########
#-------------------------------------------------------------------
def test_singleton_database():
    DatabaseManager1 = framework.DatabaseManager()  #SINGLETON
    DatabaseManager2 = framework.DatabaseManager()  #SINGLETON
    assert id(DatabaseManager1) == id(DatabaseManager2)


#TESTS VALIDATION
integer_for_test = 1234
float_for_test = 50.99
date_for_test = '05/05'  #THIS IS THE FORMAT NEEDED
string_for_test = 'This is a test'