# Path: sendinel/backend/output.py
# class VoiceOutputData(OutputData):
#     """
#     Define necessary OutputData for sending via voice.
#     """
#     
#     phone_number = None
#     
#     def send(self):
#         logger.info("Sending via Phone Call")
#         call = voicecall.Voicecall()
#         return call.conduct_call(self.phone_number, self.data, "outbound-call")
# 
# class SMSOutputData(OutputData):
#     """
#     Define necessary OutputData for sending via sms.
#     """
#     
#     phone_number = None
#     
#     def send(self):
#         logger.info("Sending via SMS")
#         vc = voicecall.Voicecall()
#         return vc.conduct_sms(self.phone_number, self.data, "outbound-sms")
# 
# class BluetoothOutputData(OutputData):
#     """
#     Define necessary OutputData for sending via bluetooth.
#     """
#     
#     bluetooth_mac_address = None
#     server_address = None
#     
#     def send(self):
#         logger.info("Sending via Bluetooth")
#         return bluetooth.send_vcal(self.server_address, 
#                             self.bluetooth_mac_address,
#                             self.data)
# 
# class OutputData(object):
#     """
#     Define an interface for OutputData.
#     """
#     
#     class Meta:
#         abstract = True
# 
#     scheduled_event = None 
#     data = None
#     def __str__(self):
#         return unicode(self.data)
#         
#     def send(self):
#         raise NotImplementedError("send() needs to be overridden.")
# 
# Path: sendinel/backend/bluetooth.py
# def set_connection_to_bluetooth(server_address):
# def get_discovered_devices(server_address):
# def send_vcal(server_address, mac, data):
# 
# Path: sendinel/backend/voicecall.py
# LINUX_AVAILABLE = False
#     LINUX_AVAILABLE = True
# class Voicecall:
#     def __init__(self):
#     def create_voicefile(self, text):
#     def create_spool_content(self, number, voicefile, salutation, extension,
#                             sip_account, context):
#     def create_sms_spool_content(self, text, number):
#     def create_spool_file(self, filename, content):
#     def move_spool_file(self, filename):
#     def replace_special_characters(self, text):
#     def conduct_sms(self, number, text, context):
#     def conduct_call(self, number, text, context): 


from django.test import TestCase
from sendinel.backend.output import VoiceOutputData, SMSOutputData, \
                                    BluetoothOutputData, OutputData
from sendinel.backend import bluetooth, voicecall
        server_address = "127"
    
        bluetoothoutput = BluetoothOutputData()
        bluetoothoutput.data = data
        bluetoothoutput.bluetooth_mac_address = mac
        bluetoothoutput.server_address = server_address
        
        def send_vcal1(server_address2, mac2, data2):
            self.assertEquals(server_address2, server_address)
            self.assertEquals(mac2, mac)
            self.assertEquals(data2, data)
              
        send_vcal_old = bluetooth.send_vcal
        bluetooth.send_vcal = send_vcal1
        bluetoothoutput.send()
        bluetooth.send_vcal = send_vcal_old

    def test_send_voiceoutputobject(self):
        phone_number = "1234"
        data = "test"
        voicecalldata = VoiceOutputData()
        voicecalldata.phone_number = phone_number
        voicecalldata.data = data
        
        def conduct_call1(self, number, text, context):
            #use class variables because of contextbinding to VoiceOutputData
            OutputTest.phone_number_value = number
            OutputTest.text_value = text
              
        conduct_call_old = voicecall.Voicecall.conduct_call

# Path: sendinel/backend/output.py
# class VoiceOutputData(OutputData):
#     """
#     Define necessary OutputData for sending via voice.
#     """
#     
#     phone_number = None
#     
#     def send(self):
#         logger.info("Sending via Phone Call")
#         call = voicecall.Voicecall()
#         return call.conduct_call(self.phone_number, self.data, "outbound-call")
# 
# class SMSOutputData(OutputData):
#     """
#     Define necessary OutputData for sending via sms.
#     """
#     
#     phone_number = None
#     
#     def send(self):
#         logger.info("Sending via SMS")
#         vc = voicecall.Voicecall()
#         return vc.conduct_sms(self.phone_number, self.data, "outbound-sms")
# 
# class BluetoothOutputData(OutputData):
#     """
#     Define necessary OutputData for sending via bluetooth.
#     """
#     
#     bluetooth_mac_address = None
#     server_address = None
#     
#     def send(self):
#         logger.info("Sending via Bluetooth")
#         return bluetooth.send_vcal(self.server_address, 
#                             self.bluetooth_mac_address,
#                             self.data)
# 
# class OutputData(object):
#     """
#     Define an interface for OutputData.
#     """
#     
#     class Meta:
#         abstract = True
# 
#     scheduled_event = None 
#     data = None
#     def __str__(self):
#         return unicode(self.data)
#         
#     def send(self):
#         raise NotImplementedError("send() needs to be overridden.")
# 
# Path: sendinel/backend/bluetooth.py
# def set_connection_to_bluetooth(server_address):
# def get_discovered_devices(server_address):
# def send_vcal(server_address, mac, data):
# 
# Path: sendinel/backend/voicecall.py
# LINUX_AVAILABLE = False
#     LINUX_AVAILABLE = True
# class Voicecall:
#     def __init__(self):
#     def create_voicefile(self, text):
#     def create_spool_content(self, number, voicefile, salutation, extension,
#                             sip_account, context):
#     def create_sms_spool_content(self, text, number):
#     def create_spool_file(self, filename, content):
#     def move_spool_file(self, filename):
#     def replace_special_characters(self, text):
#     def conduct_sms(self, number, text, context):
#     def conduct_call(self, number, text, context): 


# Path: sendinel/backend/tests/output_test.py
from django.test import TestCase
from sendinel.backend.output import VoiceOutputData, SMSOutputData, \
                                    BluetoothOutputData, OutputData
from sendinel.backend import bluetooth, voicecall

        server_address = "127"
    
        bluetoothoutput = BluetoothOutputData()
        bluetoothoutput.data = data
        bluetoothoutput.bluetooth_mac_address = mac
        bluetoothoutput.server_address = server_address
        
        def send_vcal1(server_address2, mac2, data2):
            self.assertEquals(server_address2, server_address)
            self.assertEquals(mac2, mac)
            self.assertEquals(data2, data)
              
        send_vcal_old = bluetooth.send_vcal
        bluetooth.send_vcal = send_vcal1
        bluetoothoutput.send()
        bluetooth.send_vcal = send_vcal_old

    def test_send_voiceoutputobject(self):
        phone_number = "1234"
        data = "test"
        voicecalldata = VoiceOutputData()
        voicecalldata.phone_number = phone_number
        voicecalldata.data = data
        
        def conduct_call1(self, number, text, context):
            #use class variables because of contextbinding to VoiceOutputData
            OutputTest.phone_number_value = number
            OutputTest.text_value = text
              
        conduct_call_old = voicecall.Voicecall.conduct_call

        voicecall.Voicecall.conduct_call = conduct_call1