def test_add_u_to_account(self): user_1 = User(name="1", arn="arn_1") user_2 = User(name="2", arn="arn_2") print(user_2) self.account.users.append(user_1) assert self.account.users[0] == user_1 assert len(self.account.users) == 1 self.account.users.append(user_2) assert len(self.account.users) == 2
def test_trusted_user(self): role = Role(arn=test_role_object['arn'], name=test_role_object['name'], last_used=test_role_object['last_used'], created_at=test_role_object['created_at']) user = User(name="trusted_user", arn="arn_trusted") user2 = User(name="trusted_user2", arn="arn_trusted2") role.trusted_users.append(user) role.trusted_users.append(user2) assert role.trusted_users[0] == user assert role.trusted_users[1] == user2
def setUp(self): self.user = User( arn=test_user_object['arn'], job_uuid=test_user_object['job_uuid'], created_at=test_user_object['created_at'], name=test_user_object['name'], )
def test_find_or_create(self, mock_db_query): user_new = User(arn='arn') mock_db_query.return_value.filter_by.return_value.first.return_value = user_new user = User.find_or_create("arn") assert user.arn == user_new.arn assert user == user_new