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

Commit

Permalink
Remove magic date from EVL CEG parser
Browse files Browse the repository at this point in the history
Also add the timestamp checks back in the feature test.
  • Loading branch information
robyoung committed Jul 31, 2013
1 parent fcb4d21 commit 262d023
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
18 changes: 5 additions & 13 deletions backdrop/contrib/evl_upload.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import datetime
import itertools
from tests.support.test_helpers import d_tz


def ceg_volumes(rows):
Expand All @@ -17,12 +16,11 @@ def ceg_rows(rows):
date = ceg_date(rows, column)
if not isinstance(date, datetime):
return
if date >= d_tz(2012, 4, 1):
yield [
date, "month", rows[5][column], rows[6][column],
rows[9][column], rows[11][column], rows[12][column],
rows[13][column], rows[15][column], rows[17][column]
]
yield [
date, "month", rows[5][column], rows[6][column],
rows[9][column], rows[11][column], rows[12][column],
rows[13][column], rows[15][column], rows[17][column]
]

def ceg_date(rows, column):
try:
Expand All @@ -34,9 +32,3 @@ def ceg_date(rows, column):

for row in ceg_rows(rows):
yield row






8 changes: 4 additions & 4 deletions features/contrib/evl_upload.feature
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@use_splinter_client
Feature: EVL Upload

@wip
Scenario: Upload call center volumes
Given a file named "CEG Data.xlsx" with fixture "contrib/CEG Transaction Tracker.xlsx"
and I am logged in
when I go to "/evl_ceg_data/upload"
and I enter "CEG Data.xlsx" into the file upload field
and I click "Upload"
then the platform should have "14" items stored in "evl_ceg_data"
then the platform should have "71" items stored in "evl_ceg_data"
and the "evl_ceg_data" bucket should have items:
"""
{"timeSpan":"month", "relicensing_web": 1551564, "relicensing_ivr": 251634, "relicensing_agent": 7159, "sorn_web": 207689, "sorn_ivr": 48313, "sorn_agent": 2141, "agent_automated_dupes": 7489, "calls_answered_by_advisor": 32214}
{"timeSpan":"month", "relicensing_web": 1861016, "relicensing_ivr": 300243, "relicensing_agent": 9225, "sorn_web": 208062, "sorn_ivr": 41724, "sorn_agent": 3434, "agent_automated_dupes": 6833, "calls_answered_by_advisor": 30437}
{"_timestamp": "2008-09-01T00:00:00+00:00", "timeSpan":"month", "relicensing_web": 1039833, "relicensing_ivr": 249488, "relicensing_agent": 7935, "sorn_web": 161110, "sorn_ivr": 49889, "sorn_agent": 1345, "agent_automated_dupes": 13723, "calls_answered_by_advisor": 63575}
{"_timestamp": "2012-04-01T00:00:00+00:00", "timeSpan":"month", "relicensing_web": 1551564, "relicensing_ivr": 251634, "relicensing_agent": 7159, "sorn_web": 207689, "sorn_ivr": 48313, "sorn_agent": 2141, "agent_automated_dupes": 7489, "calls_answered_by_advisor": 32214}
{"_timestamp": "2013-02-01T00:00:00+00:00", "timeSpan":"month", "relicensing_web": 1861016, "relicensing_ivr": 300243, "relicensing_agent": 9225, "sorn_web": 208062, "sorn_ivr": 41724, "sorn_agent": 3434, "agent_automated_dupes": 6833, "calls_answered_by_advisor": 30437}
"""

0 comments on commit 262d023

Please sign in to comment.