def test_cli_already_logged_in(self, logged_in_, getpass_, login_): args = {'--username': "******", "--password": "******", "--quiet": False} logged_in_.return_value = True login(args) login_.assert_not_called()
def test_cli_login_no_username(self, getpass_, login_): args = {'--username': None, "--password": None} login(args) login_.assert_not_called()
def test_cli_login(self, logged_in_, getpass_, login_): args = {'--username': "******", "--password": "******", "--quiet": False} logged_in_.return_value = False login(args) login_.assert_called_once_with("user", "pasw")
for _f in f: _f.close() else: f.close() sent_something = True # sometimes the page has to be reloaded, which would prolong the time the checking post… # message would be displayed if I didn't do this write(f"\033[2K\rchecking @{ig_profile}…") return sent_something write("loggin into instagram…") try: login({ "--username": CONF["ig_usrname"], "--password": CONF["ig_passwd"], "--quiet": False }) except Exception as e: print("\033[2K\rSomething went wrong while logging into instagram:") print(tb.format_exc()) else: print( "\033[2K\rlogged into instagram as \033[46m\033[36m{IG_USRNAME}\033[0m:\033[46m\033[36m{IG_PASSWD}\033[0m" ) async def looop_haha(): idle_for = 0 while True: updated = False