Subversion Repositories SmartDukaan

Rev

Rev 2222 | Rev 2304 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2222 Rev 2251
Line 1... Line 1...
1
from shop2020.thriftpy.model.v1.catalog.ttypes import Item, status, Warehouse,\
1
from shop2020.thriftpy.model.v1.catalog.ttypes import Item, status, Warehouse,\
2
    VendorItemPricing
2
    VendorItemPricing
3
import datetime
3
import datetime
4
from shop2020.clients.InventoryClient import InventoryClient
4
from shop2020.clients.InventoryClient import InventoryClient
5
from shop2020.utils.Utils import to_java_date
5
from shop2020.utils.Utils import to_java_date, to_py_date
6
from shop2020.model.v1.catalog.impl.DataAcessors import validate_item_prices, validate_vendor_prices
6
from shop2020.model.v1.catalog.impl.DataAcessors import validate_item_prices, validate_vendor_prices
7
 
7
 
8
 
8
 
9
inventory_client = InventoryClient()
9
inventory_client = InventoryClient()
10
 
10
 
Line 77... Line 77...
77
    print (client.checkSimilarItem('handset', 'spice', 'bldk', None))
77
    print (client.checkSimilarItem('handset', 'spice', 'bldk', None))
78
    print (client.checkSimilarItem('handset', 'spice', 'bldk', ''))
78
    print (client.checkSimilarItem('handset', 'spice', 'bldk', ''))
79
    print (client.checkSimilarItem('handset', 'spice', 'bldk', 'Black'))
79
    print (client.checkSimilarItem('handset', 'spice', 'bldk', 'Black'))
80
 
80
 
81
if __name__ == '__main__':
81
if __name__ == '__main__':
-
 
82
    time = to_py_date(datetime.datetime.now())
82
    #test_validate()
83
    #test_validate()
83
    check_similar_item()
84
    #check_similar_item()
-
 
85
    
-
 
86
    #changeItemStatus method testing
-
 
87
    """
-
 
88
    client.changeItemStatus(1, time, status.PAUSED)
-
 
89
    item = client.getItem(1)
-
 
90
    print 'item status = ' + str(item.itemStatus) + ", desc = " + item.status_description
-
 
91
    
-
 
92
    client.changeItemStatus(1, time, status.PHASED_OUT)
-
 
93
    item = client.getItem(1)
-
 
94
    print 'item status = ' + str(item.itemStatus) + ", desc = " + item.status_description
-
 
95
    """
-
 
96
    
-
 
97
    #mark_risky_item method testing. It is called from the following 3 methods.
-
 
98
    """
-
 
99
    availability = {"battery|nokia|bl 4b|na":-1}
-
 
100
    client.updateInventory(2, time, availability)
-
 
101
    
-
 
102
    client.reserveItemInWarehouse(167, 2, 1)
-
 
103
    """
-
 
104
    client.reduceReservationCount(167, 2, 1)
-
 
105
    
-
 
106
    
-
 
107
    
84
108