Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 23, 2023
1 parent dc32ad5 commit 8991ad5
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SRT/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
"ticket_info": f"{SRT_MOBILE}/ard/selectListArd02017_n.do?",
"cancel": f"{SRT_MOBILE}/ard/selectListArd02045_n.do",
"standby_option": f"{SRT_MOBILE}/ata/selectListAta01135_n.do",
}
}
2 changes: 1 addition & 1 deletion SRT/srt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import requests # type: ignore[import]

from . import constants
from .constants import STATION_CODE
from .errors import SRTError, SRTLoginError, SRTNotLoggedInError, SRTResponseError
from .passenger import Adult, Passenger
from .reservation import SRTReservation, SRTTicket
from .response_data import SRTResponseData
from .seat_type import SeatType
from .train import SRTTrain
from . import constants

EMAIL_REGEX = re.compile(r"[^@]+@[^@]+\.[^@]+")
PHONE_NUMBER_REGEX = re.compile(r"(\d{3})-(\d{3,4})-(\d{4})")
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_responses/login_fail_no_user.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"login_auto": "Y"
},
"RTNCD": "N"
}
}
2 changes: 1 addition & 1 deletion tests/mock_responses/login_fail_password.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"login_auto": "Y"
},
"RTNCD": "N"
}
}
2 changes: 1 addition & 1 deletion tests/mock_responses/login_success.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
"login_idVal": "01012341234",
"login_pwVal": "password"
}
}
}
2 changes: 1 addition & 1 deletion tests/mock_responses/logout_success.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"wctNo": "",
"uuid": ""
}
}
}
5 changes: 4 additions & 1 deletion tests/test_srt_mock.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from pathlib import Path

import pytest

mock_response_dir = Path(__file__).parent / "mock_responses"


@pytest.fixture
def mock_server(httpserver, monkeypatch):
from SRT import constants

endpoints = {
"main": httpserver.url_for("/main"),
"login": httpserver.url_for("/login"),
Expand Down Expand Up @@ -71,4 +74,4 @@ def test_logout(mock_server, httpserver):

srt = SRT("010-1234-1234", "password")
srt.logout()
assert not srt.is_login
assert not srt.is_login

0 comments on commit 8991ad5

Please sign in to comment.