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

2 years ago
  1. import pytest
  2. from fe.access.new_seller import register_new_seller
  3. import uuid
  4. class TestCreateStore:
  5. @pytest.fixture(autouse=True)
  6. def pre_run_initialization(self):
  7. self.user_id = "test_create_store_user_{}".format(str(uuid.uuid1()))
  8. self.store_id = "test_create_store_store_{}".format(str(uuid.uuid1()))
  9. self.password = self.user_id
  10. yield
  11. def test_ok(self):
  12. self.seller = register_new_seller(self.user_id, self.password)
  13. code = self.seller.create_store(self.store_id)
  14. assert code == 200
  15. def test_error_exist_store_id(self):
  16. self.seller = register_new_seller(self.user_id, self.password)
  17. code = self.seller.create_store(self.store_id)
  18. assert code == 200
  19. code = self.seller.create_store(self.store_id)
  20. assert code != 200