# Path: rwslib/extras/rwscmd/data_scrambler.py
# def typeof_rave_data(value):
#     def __init__(self, metadata=None):
#     def scramble_int(self, length):
#     def scramble_float(self, length, sd=0):
#     def scramble_date(self, value, format='%d %b %Y'):
#     def scramble_time(self, format='%H:%M:%S'):
#     def scramble_string(self, length):
#     def scramble_value(self, value):
#     def scramble_subjectname(self, value):
#     def scramble_codelist(self, codelist):
#     def scramble_itemdata(self, oid, value):
#     def scramble_query_value(self, value):
#     def fill_empty(self, fixed_values, input):
# class Scramble():
# 
# Path: rwslib/extras/rwscmd/odmutils.py
# class E_ODM(Enum):
#     """
#     Defines ODM Elements
#     """
#     CLINICAL_DATA = odm('ClinicalData')
#     SUBJECT_DATA = odm('SubjectData')
#     STUDY_EVENT_DATA = odm('StudyEventData')
#     FORM_DATA = odm('FormData')
#     ITEM_GROUP_DATA = odm('ItemGroupData')
#     ITEM_DATA = odm('ItemData')
#     METADATA_VERSION = odm('MetaDataVersion')
# 
#     USER_REF = odm('UserRef')
#     SOURCE_ID = odm('SourceID')
#     DATE_TIME_STAMP_ = odm('DateTimeStamp')
#     REASON_FOR_CHANGE = odm('ReasonForChange')
#     LOCATION_REF = odm('LocationRef')
#     QUERY = mdsol('Query')
#     PROTOCOL_DEVIATION = mdsol('ProtocolDeviation')
#     REVIEW = mdsol('Review')
#     COMMENT = mdsol('Comment')
#     SIGNATURE = odm('Signature')
#     SIGNATURE_REF = odm('SignatureRef')
#     SOURCEID = odm('SourceID')
# 
#     ITEM_DEF = odm('ItemDef')
#     RANGE_CHECK = odm('RangeCheck')
#     CODELIST_REF = odm('CodeListRef')
#     CODELIST = odm('CodeList')
#     CODELIST_ITEM = odm('CodeListItem')
#     ENUMERATED_ITEM = odm('EnumeratedItem')
# 
# class A_ODM(Enum):
#     """
#     Defines ODM Attributes
#     """
#     AUDIT_SUBCATEGORY_NAME = mdsol('AuditSubCategoryName')
#     METADATA_VERSION_OID = 'MetaDataVersionOID'
#     STUDY_OID = 'StudyOID'
#     TRANSACTION_TYPE = 'TransactionType'
#     SUBJECT_NAME = mdsol('SubjectName')
#     SUBJECT_KEY = 'SubjectKey'
#     USER_OID = 'UserOID'
#     LOCATION_OID = 'LocationOID'
#     ITEM_OID = 'ItemOID'
#     VALUE = 'Value'
#     STUDYEVENT_OID = 'StudyEventOID'
#     STUDYEVENT_REPEAT_KEY = 'StudyEventRepeatKey'
#     FORM_OID = 'FormOID'
#     FORM_REPEAT_KEY = 'FormRepeatKey'
#     ITEMGROUP_OID = 'ItemGroupOID'
#     ITEMGROUP_REPEAT_KEY = 'ItemGroupRepeatKey'
#     QUERY_REPEAT_KEY = 'QueryRepeatKey'
#     STATUS = 'Status'
#     RECIPIENT = 'Recipient'
#     RESPONSE = 'Response'
#     FREEZE = mdsol('Freeze')
#     VERIFY = mdsol('Verify')
#     LOCK = mdsol('Lock')
#     SUBJECT_STATUS = mdsol('Status')
#     PROTCOL_DEVIATION_REPEAT_KEY = 'ProtocolDeviationRepeatKey'
#     CLASS = 'Class'  # PV
#     CODE = 'Code'  # PV
#     REVIEWED = 'Reviewed' #Reviews
#     GROUP_NAME = 'GroupName'
#     COMMENT_REPEAT_KEY = 'CommentRepeatKey'
#     INSTANCE_NAME = mdsol('InstanceName')
#     INSTANCE_OVERDUE = mdsol('InstanceOverdue')
#     DATAPAGE_NAME = mdsol('DataPageName')
#     SIGNATURE_OID = 'SignatureOID'
# 
#     OID = 'OID'
#     DATATYPE = 'DataType'
#     LENGTH = 'Length'
#     SIGNIFICANT_DIGITS = 'SignficantDigits'
#     CODELIST_OID = 'CodeListOID'
#     CODED_VALUE = 'CodedValue'
#     DATETIME_FORMAT = mdsol('DateTimeFormat')


from rwslib.extras.rwscmd import data_scrambler
from rwslib.extras.rwscmd.odmutils import E_ODM, A_ODM
from lxml import etree
from six import string_types
import unittest
import datetime
            -1: 'int',
            '1': 'int',
            '1.0': 'float',
            1.1: 'float',
            'a': 'string',
            '10 MAR 2016': 'date',
            'MAR 2016': 'date',
            '2016': 'date',
            '10 03 2016': 'date',
            '03 2016': 'date',
            '10/MAR/2016': 'date',
            'MAR/2016': 'date',
            '10/03/2016': 'date',
            '03/2016': 'date',
            '10 31 2016': 'string',  # TODO:  check if this is valid Rave date format
            '9999': 'int',
            '16': 'int',
            'MAR': 'string',
            '20:45:23': 'time',
            '20:45': 'time',
            '10:45:23': 'time',
            '10:45': 'time',
            '10:45:23 AM': 'time',
            '10:45 PM': 'time'
        }


    def test_ducktype(self):
        """Test duck typing integers"""
        for value, expected_type in self.values.items():

# Path: rwslib/extras/rwscmd/data_scrambler.py
# def typeof_rave_data(value):
#     def __init__(self, metadata=None):
#     def scramble_int(self, length):
#     def scramble_float(self, length, sd=0):
#     def scramble_date(self, value, format='%d %b %Y'):
#     def scramble_time(self, format='%H:%M:%S'):
#     def scramble_string(self, length):
#     def scramble_value(self, value):
#     def scramble_subjectname(self, value):
#     def scramble_codelist(self, codelist):
#     def scramble_itemdata(self, oid, value):
#     def scramble_query_value(self, value):
#     def fill_empty(self, fixed_values, input):
# class Scramble():
# 
# Path: rwslib/extras/rwscmd/odmutils.py
# class E_ODM(Enum):
#     """
#     Defines ODM Elements
#     """
#     CLINICAL_DATA = odm('ClinicalData')
#     SUBJECT_DATA = odm('SubjectData')
#     STUDY_EVENT_DATA = odm('StudyEventData')
#     FORM_DATA = odm('FormData')
#     ITEM_GROUP_DATA = odm('ItemGroupData')
#     ITEM_DATA = odm('ItemData')
#     METADATA_VERSION = odm('MetaDataVersion')
# 
#     USER_REF = odm('UserRef')
#     SOURCE_ID = odm('SourceID')
#     DATE_TIME_STAMP_ = odm('DateTimeStamp')
#     REASON_FOR_CHANGE = odm('ReasonForChange')
#     LOCATION_REF = odm('LocationRef')
#     QUERY = mdsol('Query')
#     PROTOCOL_DEVIATION = mdsol('ProtocolDeviation')
#     REVIEW = mdsol('Review')
#     COMMENT = mdsol('Comment')
#     SIGNATURE = odm('Signature')
#     SIGNATURE_REF = odm('SignatureRef')
#     SOURCEID = odm('SourceID')
# 
#     ITEM_DEF = odm('ItemDef')
#     RANGE_CHECK = odm('RangeCheck')
#     CODELIST_REF = odm('CodeListRef')
#     CODELIST = odm('CodeList')
#     CODELIST_ITEM = odm('CodeListItem')
#     ENUMERATED_ITEM = odm('EnumeratedItem')
# 
# class A_ODM(Enum):
#     """
#     Defines ODM Attributes
#     """
#     AUDIT_SUBCATEGORY_NAME = mdsol('AuditSubCategoryName')
#     METADATA_VERSION_OID = 'MetaDataVersionOID'
#     STUDY_OID = 'StudyOID'
#     TRANSACTION_TYPE = 'TransactionType'
#     SUBJECT_NAME = mdsol('SubjectName')
#     SUBJECT_KEY = 'SubjectKey'
#     USER_OID = 'UserOID'
#     LOCATION_OID = 'LocationOID'
#     ITEM_OID = 'ItemOID'
#     VALUE = 'Value'
#     STUDYEVENT_OID = 'StudyEventOID'
#     STUDYEVENT_REPEAT_KEY = 'StudyEventRepeatKey'
#     FORM_OID = 'FormOID'
#     FORM_REPEAT_KEY = 'FormRepeatKey'
#     ITEMGROUP_OID = 'ItemGroupOID'
#     ITEMGROUP_REPEAT_KEY = 'ItemGroupRepeatKey'
#     QUERY_REPEAT_KEY = 'QueryRepeatKey'
#     STATUS = 'Status'
#     RECIPIENT = 'Recipient'
#     RESPONSE = 'Response'
#     FREEZE = mdsol('Freeze')
#     VERIFY = mdsol('Verify')
#     LOCK = mdsol('Lock')
#     SUBJECT_STATUS = mdsol('Status')
#     PROTCOL_DEVIATION_REPEAT_KEY = 'ProtocolDeviationRepeatKey'
#     CLASS = 'Class'  # PV
#     CODE = 'Code'  # PV
#     REVIEWED = 'Reviewed' #Reviews
#     GROUP_NAME = 'GroupName'
#     COMMENT_REPEAT_KEY = 'CommentRepeatKey'
#     INSTANCE_NAME = mdsol('InstanceName')
#     INSTANCE_OVERDUE = mdsol('InstanceOverdue')
#     DATAPAGE_NAME = mdsol('DataPageName')
#     SIGNATURE_OID = 'SignatureOID'
# 
#     OID = 'OID'
#     DATATYPE = 'DataType'
#     LENGTH = 'Length'
#     SIGNIFICANT_DIGITS = 'SignficantDigits'
#     CODELIST_OID = 'CodeListOID'
#     CODED_VALUE = 'CodedValue'
#     DATETIME_FORMAT = mdsol('DateTimeFormat')


# Path: rwslib/tests/test_data_scrambler.py
from rwslib.extras.rwscmd import data_scrambler
from rwslib.extras.rwscmd.odmutils import E_ODM, A_ODM
from lxml import etree
from six import string_types
import unittest
import datetime

            -1: 'int',
            '1': 'int',
            '1.0': 'float',
            1.1: 'float',
            'a': 'string',
            '10 MAR 2016': 'date',
            'MAR 2016': 'date',
            '2016': 'date',
            '10 03 2016': 'date',
            '03 2016': 'date',
            '10/MAR/2016': 'date',
            'MAR/2016': 'date',
            '10/03/2016': 'date',
            '03/2016': 'date',
            '10 31 2016': 'string',  # TODO:  check if this is valid Rave date format
            '9999': 'int',
            '16': 'int',
            'MAR': 'string',
            '20:45:23': 'time',
            '20:45': 'time',
            '10:45:23': 'time',
            '10:45': 'time',
            '10:45:23 AM': 'time',
            '10:45 PM': 'time'
        }


    def test_ducktype(self):
        """Test duck typing integers"""
        for value, expected_type in self.values.items():

            rave_type, _ = data_scrambler.typeof_rave_data(value)