当代数据库管理系统课程实验二
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

26 lines
865 B

import pytest
from fe.access.new_seller import register_new_seller
import uuid
class TestCreateStore:
@pytest.fixture(autouse=True)
def pre_run_initialization(self):
self.user_id = "test_create_store_user_{}".format(str(uuid.uuid1()))
self.store_id = "test_create_store_store_{}".format(str(uuid.uuid1()))
self.password = self.user_id
yield
def test_ok(self):
self.seller = register_new_seller(self.user_id, self.password)
code = self.seller.create_store(self.store_id)
assert code == 200
def test_error_exist_store_id(self):
self.seller = register_new_seller(self.user_id, self.password)
code = self.seller.create_store(self.store_id)
assert code == 200
code = self.seller.create_store(self.store_id)
assert code != 200