예제 #1
0
    def test_get_dimensions_for_single_item_box_package_with_dimensions_over_the_minimum(
            self):
        height = 15.0
        width = 20.0
        depth = 25.0

        package = BoxPackage()
        package.add_item(height, width, depth, 0.3)

        dimensions = package.get_dimensions()
        self.assertTupleEqual(dimensions, (height, width, depth))
예제 #2
0
    def test_get_dimensions_for_single_item_box_package_with_minimum_dimensions(
            self):
        height = 1.0
        width = 2.0
        depth = 3.0

        package = BoxPackage()
        package.add_item(height, width, depth, 0.3)

        dimensions = package.get_dimensions()
        self.assertTupleEqual(dimensions,
                              (BoxPackage.MIN_HEIGHT, BoxPackage.MIN_WIDTH,
                               BoxPackage.MIN_DEPTH))
예제 #3
0
    def test_get_dimensions_for_multiple_items_box_package_with_dimensions_over_the_minimum(
            self):
        height0 = 10
        width0 = 12
        depth0 = 25
        weight0 = 0.3

        height1 = 6
        width1 = 14
        depth1 = 20
        weight1 = 1.0

        package = BoxPackage()
        package.add_item(height0, width0, depth0, weight0)
        package.add_item(height1, width1, depth1, weight1)

        dimensions = package.get_dimensions()
        self.assertTupleEqual(dimensions, (height0 + height1, width1, depth0))
예제 #4
0
    def test_get_dimensions_for_multiple_items_box_package_with_minimum_dimensions(
            self):
        height0 = 0.5
        width0 = 0.5
        depth0 = 0.5
        weight0 = 0.3

        height1 = 0.5
        width1 = 0.8
        depth1 = 0.6
        weight1 = 1.0

        package = BoxPackage()
        package.add_item(height0, width0, depth0, weight0)
        package.add_item(height1, width1, depth1, weight1)

        dimensions = package.get_dimensions()
        self.assertTupleEqual(dimensions,
                              (BoxPackage.MIN_HEIGHT, BoxPackage.MIN_WIDTH,
                               BoxPackage.MIN_DEPTH))