コード例 #1
0
ファイル: test_saholic.py プロジェクト: phoenix24/grabber
    def setUp(self):
        self.test = file("backend/test/data/inventory/test_20120310_055847_saholic.html", "r").read()
        self.test_data = str(bsoup(self.test).fetch('div', 'productItem')[0])
        self.inventory = SaholicInventory(self.test_data)

        self.attr = attribute()
        self.item = {
            self.attr.name  : u'Alcatel  OT-230D',
            self.attr.id    : md5( 'SHOLIC_Alcatel  OT-230D' ).hexdigest(),
            self.attr.url   : u'http://saholic.com/mobile-phones/alcatel-ot-230d-1001720',
            self.attr.specs : None,
            self.attr.color : None,
            self.attr.brand : None,
            self.attr.stock : None,
            self.attr.source: u'SHOLIC',
            self.attr.price : u'949',
            self.attr.image : u"http://static2.saholic.com/images/media/1001720/alcatel-ot-230d-icon-1313564847734.jpg",
            self.attr.delivery : None
            }
コード例 #2
0
ファイル: test_flipkart.py プロジェクト: phoenix24/grabber
 def setUp(self):        
     self.test = file("backend/test/data/inventory/test_20120310_055847_flipkart.html", "r").read()
     self.test_data = str(bsoup(self.test).fetch('div', 'fk-srch-item')[0])
     self.inventory = FlipkartInventory(self.test_data)
     
     self.attr = attribute()
     
     self.item  = {
         self.attr.name  : u'Samsung Galaxy Y S5360',
         self.attr.color : u'Grey',
         self.attr.specs : u'Android v2.3 OS, 2 MP Primary Camera, 3-inch Touchscreen, FM Radio',
         self.attr.stock : u'In Stock.',
         self.attr.price : u'7650',
         self.attr.image : u'http://img1.flixcart.com//image/mobile/4/4/4/samsung-galaxy-y-s5360-125x125-imad2pzjx3uq8paz.jpeg',
         self.attr.brand : None,
         self.attr.delivery : u'2-4 business days. Free Home Delivery.',
         self.attr.source : u'FKART',
         self.attr.url    : u'http://flipkart.com//samsung-galaxy-y-s5360-mobile-phone/p/itmd2pz2rpcg5smz/search-mobile-/1?pid=mobd2pyzfanvw444&ref=c337db2d-b97a-4b4b-9061-bf3705435edd&_l=HmmZvbFeU9Oo4NUBP6Fi6Q--&_r=t2xsnCM8eE1pqUPoLth04Q--',
         self.attr.id     : md5( 'FKART_Samsung Galaxy Y S5360' ).hexdigest()
      }
コード例 #3
0
ファイル: test_infibeam.py プロジェクト: phoenix24/grabber
    def setUp(self):        
        self.test = file("backend/test/data/inventory/test_20120310_055847_infibeam.html", "r").read()
        self.test_data = str(bsoup(self.test).fetch('ul', 'srch_result portrait')[0].fetch('li')[0])

        #monkey patching test-data to get the correct minimal test-data 
        self.test_data = str("<ul class='srch_result portrait'>" +  self.test_data + "</ul>")

        #inventory object.
        self.inventory = InfibeamInventory(self.test_data)

        #inventory item to be tested against.
        self.attr = attribute()
        self.item = {
            self.attr.id    : md5( 'IBEAM_Sony Ericsson XPERIA X2 (Black)' ).hexdigest(),
            self.attr.url   : "http://infibeam.com/Mobiles/i-Sony-Ericsson-XPERIA-X2-Slider/P-E-M-Sony-Ericsson-XPERIAX2.html?id=Black",
            self.attr.name  : u'Sony Ericsson XPERIA X2 (Black)',
            self.attr.color : None,
            self.attr.specs : None,
            self.attr.stock : None,
            self.attr.brand : None,
            self.attr.price : u'25767',
            self.attr.source: u'IBEAM',
            self.attr.delivery : None,
            self.attr.image : u'http://cdn-img-a.infibeam.net/img/2ffd0b46/80/22/p-e-m-sony-ericsson-xperiax2-front-1.wm.jpg?op_sharpen=1&wid=120&hei=140'}