def test_creating_a_claim(self):
        claimant_information = {'foo': 'bar'}

        employee_record = {'foo': 'zap'}

        claim_id = add_claim(claimant_information, employee_record)
        claim = get_claim(claim_id)
        assert_that(claim[0]['foo'], is_('bar'))
        assert_that(claim[1]['foo'], is_('zap'))
Exemplo n.º 2
0
    def test_submitting_claim(self, mock_time):
        mock_time.return_value = datetime(1990, 1, 1, 1)
        claimant_data = {'foo': 'bar'}
        employee_record = {'x': '1'}

        claim_id = add_claim(claimant_data, employee_record)

        mark_claim_as_submitted(claim_id)

        claim = get_claim(claim_id)
        assert_that(claim[2], is_(datetime(1990, 1, 1, 1)))
    def test_submitting_claim(self, mock_time):
        mock_time.return_value = datetime(1990, 1, 1, 1)
        claimant_data = {'foo': 'bar'}
        employee_record = {'x': '1'}

        claim_id = add_claim(claimant_data, employee_record)

        mark_claim_as_submitted(claim_id)

        claim = get_claim(claim_id)
        assert_that(claim[2], is_(datetime(1990, 1, 1, 1)))
    def test_updating_a_claim(self):
        claimant_data = {'foo': 'bar', 'unchanged': 'grep'}
        employee_record = {'foo': 'baz'}

        updated_claimant_data = {'foo': 'mongoose', 'zap': 'pow'}

        claim_id = add_claim(claimant_data, employee_record)

        claim = get_claim(claim_id)

        assert_that(claim[0]['foo'], is_('bar'))
        assert_that(claim[0]['unchanged'], is_('grep'))
        assert_that(claim[1]['foo'], is_('baz'))

        update_claim(claim_id, claimant_information=updated_claimant_data)

        updated_claim = get_claim(claim_id)
        assert_that(updated_claim[0]['zap'], is_('pow'))
        assert_that(updated_claim[0]['foo'], is_('mongoose'))
        assert_that(updated_claim[0]['unchanged'], is_('grep'))
        assert_that(updated_claim[1]['foo'], is_('baz'))
Exemplo n.º 5
0
    def test_creating_a_claim(self):
        claimant_information = {
            'foo': 'bar'
        }

        employee_record = {
            'foo': 'zap'
        }

        claim_id = add_claim(claimant_information, employee_record)
        claim = get_claim(claim_id)
        assert_that(claim[0]['foo'], is_('bar'))
        assert_that(claim[1]['foo'], is_('zap'))
Exemplo n.º 6
0
    def test_updating_a_claim(self):
        claimant_data = {'foo': 'bar', 'unchanged': 'grep'}
        employee_record = {'foo': 'baz'}

        updated_claimant_data = {
            'foo': 'mongoose',
            'zap': 'pow'
        }

        claim_id = add_claim(claimant_data, employee_record)

        claim = get_claim(claim_id)

        assert_that(claim[0]['foo'], is_('bar'))
        assert_that(claim[0]['unchanged'], is_('grep'))
        assert_that(claim[1]['foo'], is_('baz'))

        update_claim(claim_id, claimant_information=updated_claimant_data)

        updated_claim = get_claim(claim_id)
        assert_that(updated_claim[0]['zap'], is_('pow'))
        assert_that(updated_claim[0]['foo'], is_('mongoose'))
        assert_that(updated_claim[0]['unchanged'], is_('grep'))
        assert_that(updated_claim[1]['foo'], is_('baz'))
Exemplo n.º 7
0
    def test_creating_multiple_claims(self):
        claimant_1_data = {'foo': 'bar'}
        claimant_2_data = {'foo': 'zap'}
        claimant_3_data = {'foo': 'pow'}
        employee_record_1 = {'x': '1'}
        employee_record_2 = {'x': '2'}
        employee_record_3 = {'x': '3'}
        add_claim(claimant_1_data, employee_record_1)
        add_claim(claimant_2_data, employee_record_2)

        claim_3_id = add_claim(claimant_3_data, employee_record_3)

        claim = get_claim(claim_3_id)
        assert_that(claim[0]['foo'], is_('pow'))
        assert_that(claim[1]['x'], is_('3'))
    def test_creating_multiple_claims(self):
        claimant_1_data = {'foo': 'bar'}
        claimant_2_data = {'foo': 'zap'}
        claimant_3_data = {'foo': 'pow'}
        employee_record_1 = {'x': '1'}
        employee_record_2 = {'x': '2'}
        employee_record_3 = {'x': '3'}
        add_claim(claimant_1_data, employee_record_1)
        add_claim(claimant_2_data, employee_record_2)

        claim_3_id = add_claim(claimant_3_data, employee_record_3)

        claim = get_claim(claim_3_id)
        assert_that(claim[0]['foo'], is_('pow'))
        assert_that(claim[1]['x'], is_('3'))
def find_discrepancies(claim_id):
    claim = cabinet_api.get_claim(claim_id)
    return find_discrepancies_in_claim(claim)