示例#1
0
    def test_limit(self):
        """
        Test calculating the limit.
        """

        viz = Population(drawable.Drawable)
        self.assertEqual((-0.75, -0.25), viz._limit(0.5))
示例#2
0
    def test_limit_height_one(self):
        """
        Test that when drawing with a population height of 1, the function accepts it.
        """

        viz = Population(drawable.Drawable)
        self.assertTrue(viz._limit(1))
示例#3
0
    def test_limit_order(self):
        """
        Test that the limit is a tuple in ascending order.
        """

        viz = Population(drawable.Drawable)
        limit = viz._limit(0.5)
        self.assertEqual(tuple, type(limit))
        self.assertLess(limit[0], limit[1])