コード例 #1
0
ファイル: test_doug.py プロジェクト: xregist/shtoom
# Copyright (C) 2004 Anthony Baxter
"""Tests for shtoom.doug

   These tests test doug DTMF send and receive
"""

from twisted.trial import unittest, util

from twisted.internet import defer, reactor

from shtoom.doug import VoiceApp
from shtoom.app.doug import DougApplication
from shtoom.doug.events import *
from shtoom.exceptions import CallRejected
from shtoom.i18n import install as i18n_install
i18n_install()


class TestDougApplication(DougApplication):
    _trial_def = None
    needLogging = False
    configFileName = None

    def ringBack(self):
        # ring ring
        pass

    def notifyEvent(self, event, arg):
        # Okay.
        pass
コード例 #2
0
ファイル: testcisco.py プロジェクト: braams/shtoom
# Hack hack hack.
import sys, os
f = sys.path.pop(0)
if f.endswith('scripts') and os.path.isdir(os.path.join(os.path.dirname(f),
                                                        'shtoom')):
    sys.path.insert(0, os.path.dirname(f))
else:
    sys.path.append(f)


from shtoom.doug import VoiceApp
from shtoom.doug.events import *

from shtoom.exceptions import CallRejected
from shtoom.i18n import install as i18n_install
i18n_install()

from twisted.python import log

log.FileLogObserver.timeFormat = "%Y/%m/%d %H:%M:%S"

import time

class PlayingApp(VoiceApp):

    saveFile = None
    callURL = None
    account = '2030303030'
    pin = '3030'

    def __init__(self, *args, **kwargs):