Exemplo n.º 1
0
 def test_percentage(self):
     self.assertEqual(percentage(1, 10), 10)
Exemplo n.º 2
0
def sold_share_by_site(items):
    """Each site's share in the number of items sold."""
    total = total_sold(items)
    return [(site, percentage(sold, total))
            for site, sold in sold_per_site(items)]
Exemplo n.º 3
0
def sold_share_per_category(items):
    """Each category's share in the number of items sold."""
    total = total_sold(items)
    return [(site, percentage(sold, total))
            for site, sold in sold_per_category(items)]
Exemplo n.º 4
0
def sales_share_per_category(items):
    """Each category's share in the sales volume."""
    total = total_sales(items)
    return [(cat, percentage(sold, total))
            for cat, sold in sales_per_category(items)]
Exemplo n.º 5
0
def offered_share_per_category(items):
    """Each category's share in the number of offered items."""
    total = count(items)
    return [(site, percentage(sold, total))
            for site, sold in offered_per_category(items)]
Exemplo n.º 6
0
def sold_share_per_category(items):
    """Each category's share in the number of items sold."""
    total = total_sold(items)
    return [(site, percentage(sold, total)) for site, sold in sold_per_category(items)]
Exemplo n.º 7
0
def sales_share_by_site(items):
    """Each site's share in the sales volume."""
    total = total_sales(items)
    return [(site, percentage(sold, total))
            for site, sold in sales_per_site(items)]
Exemplo n.º 8
0
def sold_share_by_site(items):
    """Each site's share in the number of items sold."""
    total = total_sold(items)
    return [(site, percentage(sold, total)) for site, sold in sold_per_site(items)]
Exemplo n.º 9
0
def offered_share_per_category(items):
    """Each category's share in the number of offered items."""
    total = count(items)
    return [(site, percentage(sold, total)) for site, sold in offered_per_category(items)]
Exemplo n.º 10
0
def sales_share_per_category(items):
    """Each category's share in the sales volume."""
    total = total_sales(items)
    return [(cat, percentage(sold, total)) for cat, sold in sales_per_category(items)]
Exemplo n.º 11
0
def sales_share_by_site(items):
    """Each site's share in the sales volume."""
    total = total_sales(items)
    return [(site, percentage(sold, total)) for site, sold in sales_per_site(items)]
Exemplo n.º 12
0
 def test_percentage(self):
     self.assertEqual(percentage(1, 10), 10)