Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
stubbing out feature and commenting on old @wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Cowling committed Aug 30, 2013
1 parent 7c33beb commit 4312bc9
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
1 change: 1 addition & 0 deletions backdrop/read/config/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# electronic vehicle licensing
"electronic_vehicle_licensing_monitoring": True,
"evl_customer_satisfaction": True,
"evl_volumetrics": True,
# fco
"deposit_foreign_marriage_journey": True,
"deposit_foreign_marriage_monitoring": True,
Expand Down
112 changes: 112 additions & 0 deletions features/fixtures/evl_volumetrics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
[
{
"transaction": "V-V85 and V85/1 HGV Licence Application",
"service": "tax-disc",
"volume": 9861.0,
"_updated_at": "2013-08-29T10:40:02.460000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVY4NSBhbmQgVjg1LzEgSEdWIExpY2VuY2UgQXBwbGljYXRpb24=",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "manual",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V85 and V85/1 HGV Licence Application EVL",
"service": "tax-disc",
"volume": 4572.0,
"_updated_at": "2013-08-29T10:40:02.289000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVY4NSBhbmQgVjg1LzEgSEdWIExpY2VuY2UgQXBwbGljYXRpb24gRVZM",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "fully-digital",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V890 Another transaction",
"service": "tax-disc",
"volume": 1017.0,
"_updated_at": "2013-08-29T09:18:31.877000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVY4OTAgQW5vdGhlciB0cmFuc2FjdGlvbg==",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "manual",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V10 Licence Application EVL",
"service": "tax-disc",
"volume": 121592.0,
"_updated_at": "2013-08-29T10:40:02.180000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVYxMCBMaWNlbmNlIEFwcGxpY2F0aW9uIEVWTA==",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "fully-digital",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V10 Licence Application Local Office",
"service": "tax-disc",
"volume": 68658.0,
"_updated_at": "2013-08-29T10:40:02.407000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVYxMCBMaWNlbmNlIEFwcGxpY2F0aW9uIExvY2FsIE9mZmljZQ==",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "manual",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V10 Licence Application Post Office",
"service": "tax-disc",
"volume": 595827.0,
"_updated_at": "2013-08-29T10:40:02.001000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVYxMCBMaWNlbmNlIEFwcGxpY2F0aW9uIFBvc3QgT2ZmaWNl",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "assisted-digital",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V11 Fleets",
"service": "tax-disc",
"volume": 92497.0,
"_updated_at": "2013-08-29T10:40:02.238000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVYxMSBGbGVldHM=",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "fully-digital",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V11 Licence Renewal Reminder EVL",
"service": "tax-disc",
"volume": 1500286.0,
"_updated_at": "2013-08-29T10:40:02.267000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVYxMSBMaWNlbmNlIFJlbmV3YWwgUmVtaW5kZXIgRVZM",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "fully-digital",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V11 Licence Renewal Reminder Local Office",
"service": "tax-disc",
"volume": 13059.0,
"_updated_at": "2013-08-29T10:40:02.429000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVYxMSBMaWNlbmNlIFJlbmV3YWwgUmVtaW5kZXIgTG9jYWwgT2ZmaWNl",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "manual",
"_timestamp": "2012-04-01T00:00:00+00:00"
},
{
"transaction": "V-V11 Licence Renewal Reminder Post Office",
"service": "tax-disc",
"volume": 1266699.0,
"_updated_at": "2013-08-29T10:40:02.075000",
"_month_start_at": "2012-04-01T00:00:00",
"_id": "MjAxMi0wNC0wMVQwMDowMDowMCswMDowMC50YXgtZGlzYy5WLVYxMSBMaWNlbmNlIFJlbmV3YWwgUmVtaW5kZXIgUG9zdCBPZmZpY2U=",
"_week_start_at": "2012-03-26T00:00:00",
"channel": "assisted-digital",
"_timestamp": "2012-04-01T00:00:00+00:00"
}
]
8 changes: 8 additions & 0 deletions features/read_api/collect.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ Feature: collect fields into grouped responses
then I should get back a status of "200"
and the "1st" result should have "value:sum" with json "27"
and the "1st" result should have "value:mean" with json "6.75"

@wip
Scenario: should be able to perform maths on sub groups
Given "evl_volumetrics.json" is in "foo" bucket
when I go to "/foo?period=month&group_by=channel&filter_by=service:tax-disc&collect=volume:sum"
then I should get back a status of "200"
and the "1st" result should have "value:sum" with json "100"
and the "1st" result should have a sub group with "volume:sum" with json "1234"

Scenario: should receive a nice error when performing invalid operation
Given "dinosaurs.json" is in "foo" bucket
Expand Down
7 changes: 7 additions & 0 deletions features/steps/read_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ def impl(context, nth, key, expected_json):
assert_that(the_data[i][key], is_(json.loads(expected_json)))


@then('the "{nth}" result should have a sub group with "{key}" with json "{expected_json}"')
def impl(context, nth, key, expected_json):
the_data = json.loads(context.response.data)['data']
i = parse_position(nth, the_data)
assert_that(the_data[i][key], is_(json.loads(expected_json)))


@then('the "{header}" header should be "{value}"')
def step(context, header, value):
assert_that(context.response.headers.get(header), is_(value))
Expand Down
1 change: 1 addition & 0 deletions features/write_api/csv_upload.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Feature: csv upload
# If the uploaded CSV does not have an _id column,
# overwrite records with the same combination of:
# start_at, end_at and key
# NB! this is a wip because selenium is buggy
@wip
Scenario: Overwrite data with matching properties
Given a file named "data.csv":
Expand Down

0 comments on commit 4312bc9

Please sign in to comment.