コード例 #1
0
ファイル: USER.py プロジェクト: anshikagoyal28/cab_booking
    def start(self):
        """
            It takes input accordingly redirects the code flow to the Admin or Employee 
            :return: True/False
            """
        try:
            print("****** WELCOME TO CAB SERVICE ******")
            ch = input("\n\nEnter\n1.Admin\n2.Employee\n3.Exit")
            if ch == '1':
                email = input("Enter email")
                password = input("Enter password")
                if check.check_email(email) == False:
                    print("******Invalid Email******")
                    return False
                admin_obj = Admin(email, password)
                if admin_obj.check():
                    return True
                else:
                    return False

            elif ch == '2':
                email = input("Enter email")
                password = input("Enter password")
                if check.check_email(email) == False:
                    print("******Invalid Email******")
                    return False
                con = DBConnection().sql_connection()
                cursorObj = con.cursor()
                emp_id = cursorObj.execute(
                    "SELECT Id from Employee where email ='{}' AND password = '******'"
                    .format(email, password)).fetchone()
                emp_obj = Employee(email, password, emp_id)
                if emp_obj.check():
                    return True
                else:
                    return False

            elif ch == '3':
                return False

            else:
                print("Invalid input")
                return False

        except IOError as e:
            print(e)
            return False
コード例 #2
0
ファイル: test_check.py プロジェクト: hoytpr/shell-novice
def test_check_email_not_default():
    assert not check.check_email('*****@*****.**')
コード例 #3
0
ファイル: test_check.py プロジェクト: hoytpr/shell-novice
def test_check_email_obfuscate():
    assert not check.check_email("user AT box DOT com")
コード例 #4
0
ファイル: test_check.py プロジェクト: hoytpr/shell-novice
def test_check_email():
    assert check.check_email("*****@*****.**")
コード例 #5
0
ファイル: test_check.py プロジェクト: hyeonsuukang/IRGN452
def test_check_email_not_default():
    assert not check.check_email('*****@*****.**')
コード例 #6
0
ファイル: test_check.py プロジェクト: hyeonsuukang/IRGN452
def test_check_email_obfuscate():
    assert not check.check_email("user AT box DOT com")
コード例 #7
0
ファイル: test_check.py プロジェクト: hyeonsuukang/IRGN452
def test_check_email():
    assert check.check_email("*****@*****.**")