Exemple #1
0
    def test_check_user_status_with_long_uuid(self):
        with allure.step("Send check user status request with long uuid"):
            check_user_status_with_long_uuid = SendRequest(
                CheckUserStatus.get_test_case("test_check_user_status_with_long_uuid"))

        with allure.step("Checking msg"):
            allure.attach("Msg contains: " + constants.ERR_MSG_LONG_UUID, "Expected")
            allure.attach("Msg: " + check_user_status_with_long_uuid.get_msg(), "Actual:")
            assert constants.ERR_MSG_LONG_UUID in check_user_status_with_long_uuid.get_msg()

        with allure.step('Checking Ret'):
            allure.attach("Ret: " + str(constants.RET_400), "Expected:")
            allure.attach("Ret: " + str(check_user_status_with_long_uuid.get_ret()), "Actual:")
            assert check_user_status_with_long_uuid.get_ret() == constants.RET_400
Exemple #2
0
    def test_check_user_status_without_token(self):
        with allure.step("Send check user status request without token"):
            check_user_status_without_token = SendRequest(
                CheckUserStatus.get_test_case(
                    "test_check_user_status_without_token"))

        with allure.step("Checking msg"):
            allure.attach("Msg contains: " + constants.ERR_MSG_WITHOUT_TOKEN,
                          "Expected")
            allure.attach("Msg: " + check_user_status_without_token.get_msg(),
                          "Actual:")
            assert constants.ERR_MSG_WITHOUT_TOKEN in check_user_status_without_token.get_msg(
            )

        with allure.step('Checking Ret'):
            allure.attach("Ret: " + str(constants.RET_400), "Expected:")
            allure.attach(
                "Ret: " + str(check_user_status_without_token.get_ret()),
                "Actual:")
            assert check_user_status_without_token.get_ret(
            ) == constants.RET_400
    def test_check_user_status_not_logged_in(self):
        with allure.step("Send check user status request(not logged in"):
            check_user_status_not_logged_in = SendRequest(
                CheckUserStatus.get_test_case(
                    "test_check_user_status_not_logged_in"))

        with allure.step('Checking Ret'):
            allure.attach("Ret: " + str(constants.RET_200), "Expected:")
            allure.attach(
                "Ret: " + str(check_user_status_not_logged_in.get_ret()),
                "Actual:")
            assert check_user_status_not_logged_in.get_ret(
            ) == constants.RET_200

        with allure.step('Checking Err_code'):
            allure.attach("Err_code: " + str(constants.ERR_CODE_1),
                          "Expected:")
            allure.attach(
                "Err_code: " +
                str(check_user_status_not_logged_in.get_err_code()), "Actual:")
            assert check_user_status_not_logged_in.get_err_code(
            ) == constants.ERR_CODE_1
    def test_check_user_status_with_short_app_key(self):
        with allure.step("Send check user status request with short app key"):
            check_user_status_with_short_app_key = SendRequest(
                CheckUserStatus.get_test_case(
                    "test_check_user_status_with_short_app_key"))

        with allure.step("Checking msg"):
            allure.attach("Msg contains: " + constants.ERR_MSG_SHORT_APP_KEY,
                          "Expected")
            allure.attach(
                "Msg: " + check_user_status_with_short_app_key.get_msg(),
                "Actual:")
            assert constants.ERR_MSG_SHORT_APP_KEY in check_user_status_with_short_app_key.get_msg(
            )

        with allure.step('Checking Ret'):
            allure.attach("Ret: " + str(constants.RET_400), "Expected:")
            allure.attach(
                "Ret: " + str(check_user_status_with_short_app_key.get_ret()),
                "Actual:")
            assert check_user_status_with_short_app_key.get_ret(
            ) == constants.RET_400
    def test_check_admin_status_logged_in(self):
        with allure.step("Send check admin status request(logged in)"):
            check_admin_status_logged_in = SendRequest(
                CheckUserStatus.get_test_case(
                    "test_check_admin_status_logged_in",
                    TestAdminStatusLoggedIn.admin_token))

        with allure.step('Checking Ret'):
            allure.attach("Ret: " + str(constants.RET_200), "Expected:")
            allure.attach(
                "Ret: " + str(check_admin_status_logged_in.get_ret()),
                "Actual:")
            assert check_admin_status_logged_in.get_ret() == constants.RET_200

        with allure.step('Checking Err_code'):
            allure.attach("Err_code: " + str(constants.ERR_CODE_0),
                          "Expected:")
            allure.attach(
                "Err_code: " +
                str(check_admin_status_logged_in.get_err_code()), "Actual:")
            assert check_admin_status_logged_in.get_err_code(
            ) == constants.ERR_CODE_0
    def test_check_user_status_with_wrong_token(self):
        with allure.step("Send check user status request with wrong token"):
            check_user_status_with_wrong_token = SendRequest(
                CheckUserStatus.get_test_case(
                    "test_check_user_status_with_wrong_token"))

        with allure.step("Checking err msg"):
            allure.attach(
                "Err msg: contains " +
                constants.ERR_MSG_CHECK_WRONG_TOKEN_OR_UUID, "Expected")
            allure.attach(
                "Err msg: " + check_user_status_with_wrong_token.get_err_msg(),
                "Actual:")
            assert constants.ERR_MSG_CHECK_WRONG_TOKEN_OR_UUID in check_user_status_with_wrong_token.get_err_msg(
            )

        with allure.step('Checking Ret'):
            allure.attach("Ret: " + str(constants.RET_200), "Expected:")
            allure.attach(
                "Ret: " + str(check_user_status_with_wrong_token.get_ret()),
                "Actual:")
            assert check_user_status_with_wrong_token.get_ret(
            ) == constants.RET_200