Exemplo n.º 1
0
    def test_flow_of_verified(self, save_verified_data_mock: MagicMock, after_save_mock: MagicMock):
        verified_data = {'fld': 'val1'}

        task = AbstractTask(info={'url': 'https://bla.pl'})

        # TODO test verification on one input
        task.verify_and_save([verified_data, verified_data])

        save_verified_data_mock.assert_called_with(verified_data)
        after_save_mock.assert_called_with(verified_data)
Exemplo n.º 2
0
    def test_verification_default_equals_false(self, after_save_mock: MagicMock, save_verified_data_mock: MagicMock):
        task = AbstractTask(info={'url': 'https://bla.pl'})

        decision = task.verify_and_save([{'fld': 'val1'}, {'fld': 'whatever'}])
        self.assertEqual(decision, False)
        after_save_mock.assert_not_called()
        save_verified_data_mock.assert_not_called()