Exemple #1
0
 def test_percentage(self):
     self.assertEqual(percentage(1, 10), 10)
Exemple #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)]
Exemple #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)]
Exemple #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)]
Exemple #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)]
Exemple #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)]
Exemple #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)]
Exemple #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)]
Exemple #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)]
Exemple #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)]
Exemple #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)]
Exemple #12
0
 def test_percentage(self):
     self.assertEqual(percentage(1, 10), 10)