Example #1
0
from db import DBReader

db_reader = DBReader()
while True:
    username_input = input("Enter your username: "******"Enter your password: ")
    db_reader.get_by_username_password(username_input, password_input)
    if type(db_reader.get_by_username_password(username_input, password_input)) == list:
        print(db_reader.get_by_username_password(username_input, password_input))
    else:
        print(db_reader.get_by_username_password(username_input, password_input))
        continue

    while True:
        print(db_reader.input_direction())
        break
Example #2
0
 def test_db_reader_get_info_from_correct_password_entry(self):
     file_input = ["bhigh,password,benjamin high,26,160"]
     db_reader = DBReader(file_input)
     self.assertEqual(db_reader.get_by_username_password("bhigh", "password"),["benjamin high","26","160"])
Example #3
0
 def test_db_reader_get_info_from_incorrect_password_entry(self):
     file_input = ["bhigh,password,benjamin high,26,160"]
     db_reader = DBReader(file_input)
     self.assertEqual(db_reader.get_by_username_password("asdf", "adfdsf"),("Either your username or password is incorrect."))
Example #4
0
 def test_db_reader_can_format_expected_file_structure(self):
     expected_input = ["bhigh,password,benjamin high,26,160", "mhigh,1234,marisa high,25,115"]
     expected_output = [["bhigh","password","benjamin high","26","160"], ["mhigh","1234","marisa high","25","115"]]
     self.assertEqual(DBReader.clean_file(expected_input), expected_output)