• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python salesmanagement.SalesManagement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中shiba.salesmanagement.SalesManagement的典型用法代码示例。如果您正苦于以下问题:Python SalesManagement类的具体用法?Python SalesManagement怎么用?Python SalesManagement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SalesManagement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_get_new_sales

def test_get_new_sales(monkeypatch):
    """regular get_new_sales test"""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_getnewsales.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))

    obj = sales_management.get_new_sales()
    assert "getnewsalesresult" in obj.content.tag
开发者ID:Phylante,项目名称:shiba,代码行数:7,代码来源:test_salesmanagement.py


示例2: test_get_shipping_information

def test_get_shipping_information(monkeypatch):
    """get_billing_information test"""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_getshippinginformation.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    obj = None
    obj = sales_management.get_shipping_information("1337")
    assert obj is not None
    assert obj.content.tag == "getshippinginformationresult"
开发者ID:Phylante,项目名称:shiba,代码行数:8,代码来源:test_salesmanagement.py


示例3: test_cancel_item

def test_cancel_item(connection):
    """cancel_item on an unknown product, must fail"""
    sales_management = SalesManagement(connection)
    obj = None
    try:
        obj = sales_management.cancel_item("1337", "comment")
    except ShibaServiceError:
        pass
    assert obj is None
开发者ID:tboulogne,项目名称:shiba,代码行数:9,代码来源:test_salesmanagement.py


示例4: test_contact_user_about_item

def test_contact_user_about_item(connection):
    """contact_user_about_item on an unknown product, must fail"""
    sales_management = SalesManagement(connection)
    obj = None
    try:
        obj = sales_management.contact_user_about_item("1337", "message")
    except ShibaServiceError:
        pass
    assert obj is None
开发者ID:tboulogne,项目名称:shiba,代码行数:9,代码来源:test_salesmanagement.py


示例5: test_get_item_infos

def test_get_item_infos(connection):
    """get_item_infos on a unknown product, must fail"""
    sales_management = SalesManagement(connection)
    obj = None
    try:
        obj = sales_management.get_item_infos("181063")
    except ShibaServiceError:
        pass
    assert obj is None
开发者ID:tboulogne,项目名称:shiba,代码行数:9,代码来源:test_salesmanagement.py


示例6: test_get_shipping_information

def test_get_shipping_information(connection):
    """get_billing_information test, will raise an error due to unknown purchaseid"""
    sales_management = SalesManagement(connection)
    obj = None
    try:
        obj = sales_management.get_shipping_information("1337")
    except ShibaServiceError:
        pass
    assert obj is None
开发者ID:tboulogne,项目名称:shiba,代码行数:9,代码来源:test_salesmanagement.py


示例7: test_refuse_sale

def test_refuse_sale(connection):
    """Only fail result, as refusing an actual sale is not simulable"""
    sales_management = SalesManagement(connection)
    itemid = "000000"
    obj = None
    try:
        obj = sales_management.refuse_sale(itemid)
    except ShibaServiceError:
        pass
    except ShibaParameterError:
        pass
开发者ID:tboulogne,项目名称:shiba,代码行数:11,代码来源:test_salesmanagement.py


示例8: test_set_tracking_package_infos

def test_set_tracking_package_infos(monkeypatch):
    """set_tracking_package_infos on a product. Testing internal error catching as well."""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_settrackingpackageinfos.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    obj = sales_management.set_tracking_package_infos("1337", "UPS", "0000000000")
    assert obj.content.tag == "setshippingpackageinfosresult"
    obj = None
    try:
        obj = sales_management.set_tracking_package_infos("1337", "Autre", "0000000000")
    except ShibaCallingError:
        pass
    assert obj is None
开发者ID:Phylante,项目名称:shiba,代码行数:12,代码来源:test_salesmanagement.py


示例9: test_confirm_preorder

def test_confirm_preorder(monkeypatch):
    """confirm_preorder on an advert. Testing internal error catching as well."""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_confirmpreorder.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    obj = sales_management.confirm_preorder("1337", 1)
    assert obj.content.tag == "confirmpreorder"
    obj = None
    try:
        obj = sales_management.confirm_preorder("1337", -8)
    except ShibaCallingError:
        pass
    assert obj is None
开发者ID:Phylante,项目名称:shiba,代码行数:12,代码来源:test_salesmanagement.py


示例10: test_accept_sale

def test_accept_sale(monkeypatch):
    """Only fail result, as accepting an actual sale is not simulable"""
    monkeypatch.setattr('requests.get', make_requests_get_mock('sample_accept_sale.xml'))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.fr.shopping.rakuten.com"))
    itemid = "000000"
    obj = None
    try:
        obj = sales_management.accept_sale(itemid)
    except ShibaServiceError:
        pass
    except ShibaParameterError:
        pass
    assert obj is not None
开发者ID:ShibaAPI,项目名称:shiba,代码行数:13,代码来源:test_salesmanagement.py


示例11: test_refuse_sale

def test_refuse_sale(monkeypatch):
    """Only fail result, as refusing an actual sale is not simulable"""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_accept_sale.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    itemid = "000000"
    obj = None
    try:
        obj = sales_management.refuse_sale(itemid)
    except ShibaServiceError:
        pass
    except ShibaParameterError:
        pass
    assert obj is not None
开发者ID:Phylante,项目名称:shiba,代码行数:13,代码来源:test_salesmanagement.py


示例12: test_get_current_sales

def test_get_current_sales(monkeypatch):
    """get_current_sales test, on variable parameters, plus some fail results"""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_getcurrentsales.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    obj = sales_management.get_current_sales()
    assert "getcurrentsalesresult" in obj.content.tag
    assert not obj.content.request.ispendingpreorder
    try:
        sales_management.get_current_sales(ispendingpreorder="n")
    except ShibaCallingError:
        pass
    obj = sales_management.get_current_sales(purchasedate="WRONGDATE")
    for elem in obj.content.response:
        assert elem.tag != "purchasedate"
开发者ID:Phylante,项目名称:shiba,代码行数:14,代码来源:test_salesmanagement.py


示例13: test_confirm_preorder

def test_confirm_preorder(connection):
    """confirm_preorder on an unknown advert, must fail. Testing internal error catching as well."""
    sales_management = SalesManagement(connection)
    obj = None
    try:
        obj = sales_management.confirm_preorder("1337", 1)
    except ShibaParameterError:
        pass
    assert obj is None
    try:
        obj = sales_management.confirm_preorder("1337", -8)
    except ShibaCallingError:
        pass
    assert obj is None
开发者ID:tboulogne,项目名称:shiba,代码行数:14,代码来源:test_salesmanagement.py


示例14: test_set_tracking_package_infos

def test_set_tracking_package_infos(connection):
    """set_tracking_package_infos on an unknown product, must fail. Testing internal error catching as well."""
    sales_management = SalesManagement(connection)
    obj = None
    try:
        obj = sales_management.set_tracking_package_infos("1337", "UPS", "0000000000")
    except ShibaParameterError:
        pass
    assert obj is None
    try:
        obj = sales_management.set_tracking_package_infos("1337", "Autre", "0000000000")
    except ShibaCallingError:
        pass
    assert obj is None
开发者ID:tboulogne,项目名称:shiba,代码行数:14,代码来源:test_salesmanagement.py


示例15: setUp

 def setUp(self):
     settings = ConfigParser.ConfigParser()
     try:
         settings.read(os.path.dirname(os.path.realpath(__file__)) + "/Assets/nosetests.cfg")
     except:
         raise ShibaCallingError("error : can't read login ID from the nosetests.cfg file")
     try:
         login = settings.get(str("NoseConfig"), "login")
         pwd = settings.get(str("NoseConfig"), "pwd")
     except:
         raise ShibaCallingError("error : configuration file doesn't seem to be regular")
     self.init = SalesManagement(ShibaConnection(login, pwd, "https://ws.sandbox.priceminister.com"))
开发者ID:Phylante,项目名称:shiba,代码行数:12,代码来源:test_salesmanagement.py


示例16: test_get_current_sales

def test_get_current_sales(connection):
    """get_current_sales test, on variable parameters, plus some fail results"""
    sales_management = SalesManagement(connection)
    obj = sales_management.get_current_sales()
    assert "getcurrentsalesresult" in obj.content.tag
    assert not obj.content.request.ispendingpreorder
    obj = sales_management.get_current_sales(ispendingpreorder="y")
    assert "getcurrentsalesresult" in obj.content.tag
    assert obj.content.request.ispendingpreorder
    try:
        sales_management.get_current_sales(ispendingpreorder="n")
    except ShibaCallingError:
        pass
    obj = sales_management.get_current_sales(purchasedate="WRONGDATE")
    for elem in obj.content.response:
        assert elem.tag != "purchasedate"
    obj = sales_management.get_current_sales(purchasedate="2012-12-21")
    assert "21/12/2012" == obj.content.request.purchasedate
开发者ID:tboulogne,项目名称:shiba,代码行数:18,代码来源:test_salesmanagement.py


示例17: test_cancel_item

def test_cancel_item(monkeypatch):
    """cancel_item test"""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_cancelitem.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    obj = sales_management.cancel_item("1337", "comment")
    assert obj.content.tag == "cancelitemresult"
开发者ID:Phylante,项目名称:shiba,代码行数:6,代码来源:test_salesmanagement.py


示例18: test_get_item_infos

def test_get_item_infos(monkeypatch):
    """get_item_infos on a product"""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_getiteminfos.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    obj = sales_management.get_item_infos("181063")
    assert obj.content.tag == "getiteminfosresult"
开发者ID:Phylante,项目名称:shiba,代码行数:6,代码来源:test_salesmanagement.py


示例19: test_get_items_todo_list

def test_get_items_todo_list(monkeypatch):
    """get_items_todo_list routine test"""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_getitemtodolist.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    obj = sales_management.get_item_todo_list()
    assert "getitemtodolistresult" in obj.content.tag
开发者ID:Phylante,项目名称:shiba,代码行数:6,代码来源:test_salesmanagement.py


示例20: test_get_billing_information

def test_get_billing_information(monkeypatch):
    """get_billing_information test, will raise an error due to unknown purchaseid"""
    monkeypatch.setattr("requests.get", make_requests_get_mock("sample_getbillinginformation.xml"))
    sales_management = SalesManagement(ShibaConnection("test", "test", "https://ws.sandbox.priceminister.com"))
    obj = sales_management.get_billing_information("1337")
    assert obj.content.tag == "getbillinginformationresult"
开发者ID:Phylante,项目名称:shiba,代码行数:6,代码来源:test_salesmanagement.py



注:本文中的shiba.salesmanagement.SalesManagement类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python shiboken.wrapInstance函数代码示例发布时间:2022-05-27
下一篇:
Python utils.NoNewAttributesAfterInit类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap