def setUpClass(cls): cls.driver = webdriver.Firefox() cls.tempdir = create_random_dir() cls.box = BoxAPI(cls.tempdir) code = authorize_box_user(cls.driver, cls.box.get_auth_url(), BOX_EMAIL, BOX_PASSWD) access_token, refresh_token = cls.box.oauth.authenticate(code) cls.box.write_access_token(access_token, refresh_token) cls.box.build()
def test_i_can_connect_with_mail_adress_and_password(self): # Given driver = webdriver.Firefox() code = authorize_box_user(driver, self.box.get_auth_url(), BOX_EMAIL, BOX_PASSWD) self.box.oauth.authenticate(code) # When self.box.build() # Then self.assertTrue(self.box.is_connected()) # Clean driver.quit()