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