Skip to content

Instantly share code, notes, and snippets.

View justinvdm's full-sized avatar

Justin van der Merwe justinvdm

View GitHub Profile
transport_name: imimobile_ussd_transport
web_path: /api/v1/imimobile/ussd
web_port: 4043
noisy: True
suffix_to_addrs:
test_integration: '9221234567' # The missed call dedicated number
middleware:
2013-02-01 14:24:43+0200 [-] Starting factory <vumi.service.AmqpFactory instance at 0x9e7498c>
2013-02-01 14:24:43+0200 [WorkerAMQClient,client] Got an authenticated connection
2013-02-01 14:24:43+0200 [WorkerAMQClient,client] Starting a EchoWorker worker with config: {'transport_name': 'imimobile_ussd_transport'}
2013-02-01 14:24:43+0200 [WorkerAMQClient,client] Starting Imimobile_ussd_transportInboundDynamicConsumer with {'exchange_name': 'vumi', 'queue_name': 'imimobile_ussd_transport.inbound', 'routing_key': 'imimobile_ussd_transport.inbound', 'exchange_type': 'direct', 'start_paused': True, 'durable': True}
2013-02-01 14:24:43+0200 [WorkerAMQClient,client] Consumer starting...
2013-02-01 14:24:43+0200 [WorkerAMQClient,client] Starting Imimobile_ussd_transportEventDynamicConsumer with {'exchange_name': 'vumi', 'queue_name': 'imimobile_ussd_transport.event', 'routing_key': 'imimobile_ussd_transport.event', 'exchange_type': 'direct', 'start_paused': True, 'durable': True}
2013-02-01 14:24:43+0200 [WorkerAMQ
diff --git a/prd-puppet.aws.praekelt.com/puppet/modules/vumi-go/files/haproxy.cfg b/prd-puppet.aws.praekelt.com/puppet/modules/vumi-go/files/haproxy.cfg
index 6b4a159..9767f55 100644
--- a/prd-puppet.aws.praekelt.com/puppet/modules/vumi-go/files/haproxy.cfg
+++ b/prd-puppet.aws.praekelt.com/puppet/modules/vumi-go/files/haproxy.cfg
@@ -44,6 +44,9 @@ frontend http-in
acl is_imimobile_ussd url_beg /api/v1/imimobile/ussd
use_backend imimobile_ussd if is_imimobile_ussd
+ acl is_apposit_sms url_beg /api/v1/apposit/sms
+ use_backend apposit_sms if is_apposit_sms
diff --git a/vumi/transports/apposit/apposit.py b/vumi/transports/apposit/apposit.py
index 937e353..ee7e05d 100644
--- a/vumi/transports/apposit/apposit.py
+++ b/vumi/transports/apposit/apposit.py
@@ -1,3 +1,5 @@
+# -*- test-case-name: vumi.transports.apposit.tests.test_apposit -*-
+
import json
from urllib import urlencode
def concentrate_datapoints(datapoints, from_time, bucket_size):
step = from_time
results = []
for datapoint in datapoints:
if datapoint['x'] >= step:
results.append(datapoint)
step += bucket_size
return results
class NullFilter(object):
FILTERS = {
'skip': 'skip_nulls',
'zeroize': 'zeroize_nulls',
}
@classmethod
def from_name(cls, name):
attr = cls.FILTERS.get(name)
return getattr(cls, attr) if attr else lambda x: x
var routing = {
channels: [{
uuid: 'channel-uuid-1',
tag: ['apposit_sms', '*121#'],
name: '*121#',
description: 'Apposit Sms: *121#',
endpoints: [{uuid: 'endpoint-uuid-1', name: 'default'}]
}],
routing_blocks: [{
uuid: 'routing-block-uuid-1',
diff --git a/go/base/static/js/src/campaign/routing/routing-models.js b/go/base/static/js/src/campaign/routing/routing-models.js
index a852813..1522dbe 100644
--- a/go/base/static/js/src/campaign/routing/routing-models.js
+++ b/go/base/static/js/src/campaign/routing/routing-models.js
@@ -55,7 +55,7 @@ var stateMachine = go.components.stateMachine,
});
var CampaignRoutingModel = StateMachineModel.extend({
- idAttribute: 'uuid',
+ idAttribute: 'campaign_id',
diff --git a/go/base/static/js/test/tests/components/views.test.js b/go/base/static/js/test/tests/components/views.test.js
index 2342634..30c9f56 100644
--- a/go/base/static/js/test/tests/components/views.test.js
+++ b/go/base/static/js/test/tests/components/views.test.js
@@ -17,6 +17,12 @@ describe("go.components.views", function() {
var label;
+ var assertOffset = function(el, expectedOffset) {
+ var offset = $(el).offset();
diff --git a/go/base/static/js/test/tests/components/plumbing/endpoints.test.js b/go/base/static/js/test/tests/components/plumbing/endpoints.test.js
index 8a2c2aa..21bc7d5 100644
--- a/go/base/static/js/test/tests/components/plumbing/endpoints.test.js
+++ b/go/base/static/js/test/tests/components/plumbing/endpoints.test.js
@@ -325,7 +325,7 @@ describe("go.components.plumbing (endpoints)", function() {
var assertAlignment = function() {
var expected = Array.prototype.slice.call(arguments);
endpoints.each(function(e, i) {
- assert.closeTo(e.t, expected[i], 0.0000001);
+ assert.closeTo(e.t, expected[i], 0.01);