def test_configure_with_none_token(self): cfg = EobotConfig() cfg.configure(token="token") self.assertEqual("token", cfg._token) cfg.configure(token=None) self.assertIsNone(cfg._token)
def test_configure_with_none_email(self): cfg = EobotConfig() cfg.configure(email="email") self.assertEqual("email", cfg._email) cfg.configure(email=None) self.assertIsNone(cfg._email)
def test_configure_with_none_password(self): cfg = EobotConfig() cfg.configure(password="******") self.assertEqual("password", cfg._password) cfg.configure(password=None) self.assertIsNone(cfg._password)
def test_configure_with_none_user_id(self): cfg = EobotConfig() cfg.configure(user_id=123) self.assertEqual(123, cfg._user_id) cfg.configure(user_id=None) self.assertIsNone(cfg._user_id)
def test_has_password(self): cfg = EobotConfig() self.assertFalse(cfg.has_password()) cfg.configure(password="******") self.assertTrue(cfg.has_password()) cfg.configure(password=None) self.assertFalse(cfg.has_password())
def test_has_email(self): cfg = EobotConfig() self.assertFalse(cfg.has_email()) cfg.configure(email="email") self.assertTrue(cfg.has_email()) cfg.configure(email=None) self.assertFalse(cfg.has_email())
def test_has_token(self): cfg = EobotConfig() self.assertFalse(cfg.has_token()) cfg.configure(token="token") self.assertTrue(cfg.has_token()) cfg.configure(token=None) self.assertFalse(cfg.has_token())
def test_has_user_id(self): cfg = EobotConfig() self.assertFalse(cfg.has_user_id()) cfg.configure(user_id=123) self.assertTrue(cfg.has_user_id()) cfg.configure(user_id=None) self.assertFalse(cfg.has_user_id())
def test_configure_with_valid_parameters(self): cfg = EobotConfig() self.assertIsNone(cfg._user_id) self.assertIsNone(cfg._email) self.assertIsNone(cfg._password) self.assertIsNone(cfg._token) cfg.configure(user_id=123, email="email", password="******", token="token") self.assertEqual(123, cfg._user_id) self.assertEqual("email", cfg._email) self.assertEqual("password", cfg._password) self.assertEqual("token", cfg._token)
def test_configure_set_single_parameter(self): cfg = EobotConfig() cfg.configure(user_id=123, email="email", password="******", token="token") self.assertEqual(123, cfg._user_id) self.assertEqual("email", cfg._email) self.assertEqual("password", cfg._password) self.assertEqual("token", cfg._token) cfg.configure(email="otheremail") # only email should be changed self.assertEqual(123, cfg._user_id) self.assertEqual("otheremail", cfg._email) self.assertEqual("password", cfg._password) self.assertEqual("token", cfg._token)
def test_configure_with_valid_email(self): cfg = EobotConfig() cfg.configure(email="email") self.assertEqual("email", cfg._email)
def test_configure_with_invalid_user_id(self): cfg = EobotConfig() with self.assertRaises(ValueError): # noinspection PyTypeChecker cfg.configure(user_id="123")
def test_configure_with_valid_user_id(self): cfg = EobotConfig() cfg.configure(user_id=123) self.assertEqual(123, cfg._user_id)
def test_set_token_with_none_value(self): cfg = EobotConfig() cfg.configure(token="token") self.assertEqual("token", cfg._token) cfg.set_token(None) self.assertIsNone(cfg._token)
def test_configure_with_valid_token(self): cfg = EobotConfig() cfg.configure(token="token") self.assertEqual("token", cfg._token)
def test_configure_with_valid_password(self): cfg = EobotConfig() cfg.configure(password="******") self.assertEqual("password", cfg._password)
def test_set_email_with_none_value(self): cfg = EobotConfig() cfg.configure(email="email") self.assertEqual("email", cfg._email) cfg.set_email(None) self.assertIsNone(cfg._email)
def test_set_user_id_with_none_value(self): cfg = EobotConfig() cfg.configure(user_id=123) self.assertEqual(123, cfg._user_id) cfg.set_user_id(None) self.assertIsNone(cfg._user_id)
def test_configure_with_invalid_password(self): cfg = EobotConfig() with self.assertRaises(ValueError): # noinspection PyTypeChecker cfg.configure(password=123)
def test_set_password_with_none_value(self): cfg = EobotConfig() cfg.configure(password="******") self.assertEqual("password", cfg._password) cfg.set_password(None) self.assertIsNone(cfg._password)