Example #1
0
    def test_lift_pallets_with_out_path(self, process_pallets,
                                        process_crates_for, git_update):
        config.set_config_prop('warehouse', test_pallets_folder, override=True)
        engine.lift_pallets()

        self.assertEqual(len(process_crates_for.call_args[0][0]), 4)
        self.assertEqual(len(process_pallets.call_args[0][0]), 4)
Example #2
0
    def test_lift_pallets_alphebetical_order(self, process_pallets,
                                             process_crates_for, git_update):
        engine.lift_pallets(join(test_data_folder, 'alphabetize', 'pallet.py'))

        order = [
            p.__class__.__name__ for p in process_crates_for.call_args[0][0]
        ]

        self.assertEqual(order, ['Pallet1', 'Pallet2', 'Pallet3'])
Example #3
0
    def test_lift_pallets_pallet_arg(self, process_pallets, process_crates_for, git_update):
        engine.lift_pallets(join(test_data_folder, 'pallet_argument.py'), 'test')

        pallet = process_crates_for.call_args[0][0][0]
        self.assertEqual(pallet.arg, 'test')

        engine.lift_pallets(join(test_data_folder, 'pallet_argument.py'))

        pallet = process_crates_for.call_args[0][0][0]
        self.assertEqual(pallet.arg, None)
Example #4
0
    def test_lift_pallets_prepare_packaging(self, prepare_mock,
                                            process_pallets,
                                            process_crates_for, git_update):
        engine.lift_pallets(join(test_data_folder, 'pallet_argument.py'))

        prepare_mock.assert_called_once()
Example #5
0
    def test_lift_pallets_with_path(self, process_pallets, process_crates_for,
                                    git_update):
        engine.lift_pallets(join(test_pallets_folder, 'multiple_pallets.py'))

        self.assertEqual(len(process_crates_for.call_args[0][0]), 2)
        self.assertEqual(len(process_pallets.call_args[0][0]), 2)