Ejemplo n.º 1
0
    def test_ChangingPackageStatuses(self):
        # DeliveryStep = 0, first status
        package = PackageObjectMother.CreatePackageNoPickupsNoReturn()
        package2 = PackageObjectMother.CreatePackageNoPickupsNoReturn()
        statuses = Package.FindAllPackageStatuses()

        for status in statuses:
            package.GetStatus().Name = status.Name
            self.assertEqual(package.GetStatus().Name,
                             package2.GetStatus().Name)
            self.assertEqual(package.GetStatus().DeliveryStep,
                             package2.GetStatus().DeliveryStep)
            package2.GetStatus().NextDeliveryStep()
Ejemplo n.º 2
0
    def test_ChangePackageStatusForwardAndBackward(self):
        package = PackageObjectMother.CreatePackageNoPickupsNoReturn()
        package2 = PackageObjectMother.CreatePackageNoPickupsNoReturn()
        statuses = Package.FindAllPackageStatuses()
        statusNames = [status.Name for status in statuses]

        for i in range(10):
            for j in range(i):
                package.GetStatus().NextDeliveryStep()
            assert package.GetStatus().Name in statusNames
            for j in range(i):
                package.GetStatus().PrevDeliveryStep()
            assert package.GetStatus().Name == package2.GetStatus().Name
Ejemplo n.º 3
0
 def GetAllPackageStatuses(self):
     return Package.FindAllPackageStatuses()