Example #1
0
 def test_free_price(self):
     values = {'display_price': "Free"}
     mock_property_helper = get_mock_app_properties_helper(values)
     # we don't really need a "doc" on second input as we mock the helper
     button = FeaturedTile(mock_property_helper, None)
     self.assertEqual(
         button.price.get_label(), '<span font_desc="10">Free</span>')
Example #2
0
 def test_feature_tile_dup_symbol(self):
     values = {'display_price': 'US$ 1.00' }
     mock_property_helper = get_mock_app_properties_helper(values)
     # we don't really need a "doc" on second input as we mock the helper
     button = FeaturedTile(mock_property_helper, None)
     self.assertEqual(
         button.price.get_label(), '<span font_desc="10">US$ 1.00</span>')
Example #3
0
 def _add_tiles_to_flowgrid(self, docs, flowgrid, amount):
     '''Adds application tiles to a FlowableGrid:
        docs = xapian documents (apps)
        flowgrid = the FlowableGrid to add tiles to
        amount = number of tiles to add from start of doc range'''
     amount = min(len(docs), amount)
     for doc in docs[0:amount]:
         tile = FeaturedTile(self.helper, doc)
         tile.connect('clicked', self.on_app_clicked,
                      self.helper.get_application(doc))
         flowgrid.add_child(tile)
     return
Example #4
0
 def add_tiles(self, properties_helper, docs, amount):
     '''Adds application tiles to an ApplicationTileGrid:
             properties_help -- an instance of the PropertiesHelper object
             docs -- xapian documents (apps)
             amount -- number of tiles to add from start of doc range
     '''
     amount = min(len(docs), amount)
     for doc in docs[0:amount]:
         tile = FeaturedTile(properties_helper, doc)
         tile.connect('clicked', self._on_app_clicked,
                      properties_helper.get_application(doc))
         self.add_child(tile)