예제 #1
0
파일: tests.py 프로젝트: Lomascolo/daywatch
 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)