# Path: oaxmlapi/connections.py
# class Application(object):
# class Auth(_Base):
# class RemoteAuth(_Base):
# class Whoami(_Base):
# class Request(_Base):
# class Error(_Base):
#     def __init__(self, client, client_version, namespace, key):
#     def __str__(self):
#     def __init__(self, company, username, password):
#     def __str__(self):
#     def auth(self):
#     def _main(self):
#     def __init__(self, company, username, password):
#     def __str__(self):
#     def remoteauth(self):
#     def _main(self):
#     def __init__(self, datatype):
#     def __str__(self):
#     def datatype(self):
#     def datatype(self, d):
#     def whoami(self):
#     def _main(self):
#     def __init__(self, application, auth, xml_data):
#     def __str__(self):
#     def request(self):
#     def _main(self):
#     def __init__(self, application, code):
#     def __str__(self):
#     def error(self):
#     def _main(self):
# 
# Path: oaxmlapi/datatypes.py
# class Datatype(_Base):
#     def __init__(self, type, fields):
#     def __str__(self):
#     def getDatatype(self):
#     def _main(self):
# 
# Path: oaxmlapi/commands.py
# class Time(_Base):
# class Read(_Base):
#     class Filter(object):
# class Report(_Base):
# class Add(_Base):
# class Delete(_Base):
# class Modify(_Base):
# class ModifyOnCondition(_Base):
# class Submit(_Base):
# class CreateAccount(_Base):
# class CreateUser(_Base):
# class Switch(_Base):
# class MakeURL(_Base):
#     def __init__(self):
#     def __str__(self):
#     def time(self):
#     def _main(self):
#     def __init__(self, type, method, attribs, filters=None, orderby=None, fields=None):
#     def __str__(self):
#     def method(self):
#     def method(self, m):
#     def read(self):
#     def _main(self):
#         def __init__(self, filter, fieldname, datatype):
#         def __str__(self):
#         def getFilter(self):
#     def __init__(self, type, datatype):
#     def __str__(self):
#     def type(self):
#     def type(self, t):
#     def getReport(self):
#     def _main(self):
#     def __init__(self, type, attribs, datatype):
#     def __str__(self):
#     def type(self):
#     def type(self, t):
#     def add(self):
#     def _main(self):
#     def __init__(self, type, datatype):
#     def __str__(self):
#     def delete(self):
#     def _main(self):
#     def __init__(self, type, attribs, datatype):
#     def __str__(self):
#     def modify(self):
#     def _main(self):
#     def __init__(self, type, datatype1, datatype2):
#     def __str__(self):
#     def modify(self):
#     def _main(self):
#     def __init__(self, type, datatype, approval):
#     def __str__(self):
#     def type(self):
#     def type(self, t):
#     def submit(self):
#     def _main(self):
#     def __init__(self, company, user):
#     def __str__(self):
#     def company(self):
#     def company(self, c):
#     def user(self):
#     def user(self, u):
#     def create(self):
#     def _main(self):
#     def __init__(self, company, user):
#     def __str__(self):
#     def company(self):
#     def company(self, c):
#     def user(self):
#     def user(self, u):
#     def create(self):
#     def _main(self):
#     def __init__(self, type, datatype):
#     def __str__(self):
#     def type(self):
#     def type(self, t):
#     def switch(self):
#     def _main(self):
#     def __init__(self, uid, page, app, arg):
#     def __str__(self):
#     def page(self):
#     def page(self, p):
#     def app(self):
#     def app(self, a):
#     def makeurl(self):
#     def _main(self):


import unittest
    import xml.etree.cElementTree as ET
    import xml.etree.ElementTree as ET
from oaxmlapi import connections, datatypes, commands
        )

    def test_request(self):
        app = connections.Application('test', '1.0', 'default', 'abc123')
        auth = connections.Auth('company', 'username', 'p@ssw0rd')
        time = [commands.Time().time()]
        self.assertIsInstance(
            connections.Request(app, auth, time).request(),
            ET.Element
        )

    def test_tostring_auth(self):
        app = connections.Application('test', '1.0', 'default', 'abc123')
        auth = connections.Auth('company', 'username', 'p@ssw0rd')
        time = [commands.Time().time()]
        self.assertEqual(
            connections.Request(app, auth, time).tostring(),
            (
                b'<?xml version="1.0" encoding="utf-8"?>'
                b'<request API_ver="1.0" client="test" client_ver="1.0" '
                b'key="abc123" namespace="default"><Auth><Login>'
                b'<company>company</company><user>username</user>'
                b'<password>p@ssw0rd</password></Login></Auth>'
                b'<Time /></request>'
            )
        )

    def test_tostring_remoteauth(self):
        app = connections.Application('test', '1.0', 'default', 'abc123')
        remoteauth = connections.RemoteAuth('company', 'username', 'p@ssw0rd')

# Path: oaxmlapi/connections.py
# class Application(object):
# class Auth(_Base):
# class RemoteAuth(_Base):
# class Whoami(_Base):
# class Request(_Base):
# class Error(_Base):
#     def __init__(self, client, client_version, namespace, key):
#     def __str__(self):
#     def __init__(self, company, username, password):
#     def __str__(self):
#     def auth(self):
#     def _main(self):
#     def __init__(self, company, username, password):
#     def __str__(self):
#     def remoteauth(self):
#     def _main(self):
#     def __init__(self, datatype):
#     def __str__(self):
#     def datatype(self):
#     def datatype(self, d):
#     def whoami(self):
#     def _main(self):
#     def __init__(self, application, auth, xml_data):
#     def __str__(self):
#     def request(self):
#     def _main(self):
#     def __init__(self, application, code):
#     def __str__(self):
#     def error(self):
#     def _main(self):
# 
# Path: oaxmlapi/datatypes.py
# class Datatype(_Base):
#     def __init__(self, type, fields):
#     def __str__(self):
#     def getDatatype(self):
#     def _main(self):
# 
# Path: oaxmlapi/commands.py
# class Time(_Base):
# class Read(_Base):
#     class Filter(object):
# class Report(_Base):
# class Add(_Base):
# class Delete(_Base):
# class Modify(_Base):
# class ModifyOnCondition(_Base):
# class Submit(_Base):
# class CreateAccount(_Base):
# class CreateUser(_Base):
# class Switch(_Base):
# class MakeURL(_Base):
#     def __init__(self):
#     def __str__(self):
#     def time(self):
#     def _main(self):
#     def __init__(self, type, method, attribs, filters=None, orderby=None, fields=None):
#     def __str__(self):
#     def method(self):
#     def method(self, m):
#     def read(self):
#     def _main(self):
#         def __init__(self, filter, fieldname, datatype):
#         def __str__(self):
#         def getFilter(self):
#     def __init__(self, type, datatype):
#     def __str__(self):
#     def type(self):
#     def type(self, t):
#     def getReport(self):
#     def _main(self):
#     def __init__(self, type, attribs, datatype):
#     def __str__(self):
#     def type(self):
#     def type(self, t):
#     def add(self):
#     def _main(self):
#     def __init__(self, type, datatype):
#     def __str__(self):
#     def delete(self):
#     def _main(self):
#     def __init__(self, type, attribs, datatype):
#     def __str__(self):
#     def modify(self):
#     def _main(self):
#     def __init__(self, type, datatype1, datatype2):
#     def __str__(self):
#     def modify(self):
#     def _main(self):
#     def __init__(self, type, datatype, approval):
#     def __str__(self):
#     def type(self):
#     def type(self, t):
#     def submit(self):
#     def _main(self):
#     def __init__(self, company, user):
#     def __str__(self):
#     def company(self):
#     def company(self, c):
#     def user(self):
#     def user(self, u):
#     def create(self):
#     def _main(self):
#     def __init__(self, company, user):
#     def __str__(self):
#     def company(self):
#     def company(self, c):
#     def user(self):
#     def user(self, u):
#     def create(self):
#     def _main(self):
#     def __init__(self, type, datatype):
#     def __str__(self):
#     def type(self):
#     def type(self, t):
#     def switch(self):
#     def _main(self):
#     def __init__(self, uid, page, app, arg):
#     def __str__(self):
#     def page(self):
#     def page(self, p):
#     def app(self):
#     def app(self, a):
#     def makeurl(self):
#     def _main(self):


# Path: tests/connections/test_request.py
import unittest
    import xml.etree.cElementTree as ET
    import xml.etree.ElementTree as ET
from oaxmlapi import connections, datatypes, commands

        )

    def test_request(self):
        app = connections.Application('test', '1.0', 'default', 'abc123')
        auth = connections.Auth('company', 'username', 'p@ssw0rd')
        time = [commands.Time().time()]
        self.assertIsInstance(
            connections.Request(app, auth, time).request(),
            ET.Element
        )

    def test_tostring_auth(self):
        app = connections.Application('test', '1.0', 'default', 'abc123')
        auth = connections.Auth('company', 'username', 'p@ssw0rd')
        time = [commands.Time().time()]
        self.assertEqual(
            connections.Request(app, auth, time).tostring(),
            (
                b'<?xml version="1.0" encoding="utf-8"?>'
                b'<request API_ver="1.0" client="test" client_ver="1.0" '
                b'key="abc123" namespace="default"><Auth><Login>'
                b'<company>company</company><user>username</user>'
                b'<password>p@ssw0rd</password></Login></Auth>'
                b'<Time /></request>'
            )
        )

    def test_tostring_remoteauth(self):
        app = connections.Application('test', '1.0', 'default', 'abc123')
        remoteauth = connections.RemoteAuth('company', 'username', 'p@ssw0rd')

        time = [commands.Time().time()]