-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: 99cloud <qiao.lei@99cloud.net>
- Loading branch information
Showing
51 changed files
with
2,484 additions
and
725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
fixtures: | ||
- ConfigFixture | ||
- SampleDataFixture | ||
|
||
defaults: | ||
ssl: False | ||
request_headers: | ||
content-type: application/json | ||
accept: application/json | ||
|
||
vars: | ||
- &username 'gabbi_user' | ||
- &password 'dandelion' | ||
|
||
tests: | ||
- name: create_user | ||
url: /api/v1/users | ||
method: POST | ||
data: | ||
username: *username | ||
password: *password | ||
is_active: true | ||
status: 200 | ||
response_json_paths: | ||
$.username: *username | ||
|
||
- name: user_login | ||
url: /api/v1/login | ||
method: POST | ||
data: | ||
username: *username | ||
password: *password | ||
status: 200 | ||
response_json_paths: | ||
$.token_type: bearer | ||
|
||
- name: create_rsu_model | ||
url: /api/v1/rsu_models | ||
method: POST | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
data: | ||
name: 蓝天SD726 | ||
manufacturer: 蓝天科技 | ||
desc: 蓝天726 | ||
status: 201 | ||
response_json_paths: | ||
$.name: 蓝天SD726 | ||
$.manufacturer: 蓝天科技 | ||
$.desc: 蓝天726 | ||
|
||
- name: create_rsu | ||
url: /api/v1/rsus | ||
method: POST | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
data: | ||
rsuId: 'RSU_ID_01' | ||
rsuName: 'RSU_NAME_01' | ||
rsuEsn: 'RSU_ESN01' | ||
rsuIP: '192.168.0.101' | ||
rsuModelId: $HISTORY['create_rsu_model'].$RESPONSE['$.id'] | ||
desc: 'test_rsu' | ||
lon: 118.8213963998263 | ||
lat: 31.934846637757847 | ||
status: 201 | ||
response_json_paths: | ||
$.rsuId: 'RSU_ID_01' | ||
$.rsuName: 'RSU_NAME_01' | ||
$.rsuEsn: 'RSU_ESN01' | ||
$.rsuIP: '192.168.0.101' | ||
$.rsuModelId: $HISTORY['create_rsu_model'].$RESPONSE['$.id'] | ||
|
||
- name: create_radar_camera | ||
url: /api/v1/radar_cameras | ||
method: POST | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
data: | ||
name: 'RadarCamera_NAME_01' | ||
sn: 'RadarCamera_SN_01' | ||
lng: 118.79576 | ||
lat: 32.051433 | ||
elevation: "1" | ||
towards: "90" | ||
point: "1" | ||
pole: "1" | ||
radarCameraIP: '1.1.1.1' | ||
videoStreamAddress: "http://127.0.0.1:28300/" | ||
rsuID: $HISTORY['create_rsu'].$RESPONSE['$.id'] | ||
desc: 'test_radar_camera' | ||
status: 201 | ||
|
||
- name: radar_camera_list | ||
url: /api/v1/radar_cameras | ||
method: GET | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
data: | ||
sn: "RadarCamera_SN_01" | ||
name: "RadarCamera_NAME_01" | ||
pageNum: 1 | ||
pageSize: 10 | ||
status: 200 | ||
|
||
- name: radar_camera_info | ||
url: /api/v1/radar_cameras/$HISTORY['create_radar_camera'].$RESPONSE['$.id'] | ||
method: GET | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
status: 200 | ||
response_json_paths: | ||
$.sn: 'RadarCamera_SN_01' | ||
$.name: 'RadarCamera_NAME_01' | ||
$.rsuID: $HISTORY['create_rsu'].$RESPONSE['$.id'] | ||
$.radarCameraIP: '1.1.1.1' | ||
|
||
- name: update_radar_camera | ||
url: /api/v1/radar_cameras/$HISTORY['create_radar_camera'].$RESPONSE['$.id'] | ||
method: PATCH | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
data: | ||
sn: 'RadarCamera_SN_03' | ||
name: 'RadarCamera_NAME_02' | ||
radarCameraIP: '192.168.0.102' | ||
lng: 117.79576 | ||
lat: 33.051433 | ||
elevation: 0 | ||
towards: 90 | ||
rsuID: $HISTORY['create_rsu'].$RESPONSE['$.id'] | ||
desc: 'test_update_radar_camera' | ||
status: 200 | ||
response_json_paths: | ||
$.sn: 'RadarCamera_SN_03' | ||
$.name: 'RadarCamera_NAME_02' | ||
$.radarCameraIP: '192.168.0.102' | ||
$.desc: 'test_update_radar_camera' | ||
|
||
- name: delete_radar | ||
url: /api/v1/radar_cameras/$HISTORY['create_radar_camera'].$RESPONSE['$.id'] | ||
method: DELETE | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
status: 204 | ||
|
||
- name: delete_rsu | ||
url: /api/v1/rsus/$HISTORY['create_rsu'].$RESPONSE['$.id'] | ||
method: DELETE | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
status: 204 | ||
|
||
- name: delete_rsu_model | ||
url: /api/v1/rsu_models/$HISTORY['create_rsu_model'].$RESPONSE['$.id'] | ||
method: DELETE | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
status: 204 | ||
|
||
- name: delete_user | ||
url: /api/v1/users/$HISTORY['create_user'].$RESPONSE['$.id'] | ||
method: DELETE | ||
request_headers: | ||
Authorization: Bearer $HISTORY['user_login'].$RESPONSE['$.access_token'] | ||
status: 204 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"""radar_camera | ||
Revision ID: 26c910b0342f | ||
Revises: 556f61d01468 | ||
Create Date: 2023-04-17 11:21:52.089414 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "26c910b0342f" | ||
down_revision = "556f61d01468" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"radar_camera", | ||
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False), | ||
sa.Column("create_time", sa.DateTime(), nullable=False), | ||
sa.Column("update_time", sa.DateTime(), nullable=False), | ||
sa.Column("name", sa.String(length=64), nullable=False), | ||
sa.Column("sn", sa.String(length=64), nullable=False), | ||
sa.Column("lng", sa.Float(), nullable=False), | ||
sa.Column("lat", sa.Float(), nullable=False), | ||
sa.Column("elevation", sa.Float(), nullable=False), | ||
sa.Column("towards", sa.Float(), nullable=False), | ||
sa.Column("point", sa.String(length=15), nullable=False), | ||
sa.Column("pole", sa.String(length=15), nullable=False), | ||
sa.Column("video_stream_address", sa.String(length=255), nullable=False), | ||
sa.Column("radar_camera_ip", sa.String(length=15), nullable=False), | ||
sa.Column("rsu_id", sa.Integer(), nullable=True), | ||
sa.Column("status", sa.Boolean(), nullable=False), | ||
sa.Column("desc", sa.String(length=255), nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["rsu_id"], | ||
["rsu.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
op.create_index(op.f("ix_radar_camera_id"), "radar_camera", ["id"], unique=False) | ||
op.create_index(op.f("ix_radar_camera_name"), "radar_camera", ["name"], unique=True) | ||
op.create_index(op.f("ix_radar_camera_sn"), "radar_camera", ["sn"], unique=True) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f("ix_radar_camera_sn"), table_name="radar_camera") | ||
op.drop_index(op.f("ix_radar_camera_name"), table_name="radar_camera") | ||
op.drop_index(op.f("ix_radar_camera_id"), table_name="radar_camera") | ||
op.drop_table("radar_camera") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.