# 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):


import unittest
    import xml.etree.cElementTree as ET
    import xml.etree.ElementTree as ET
from oaxmlapi import connections, datatypes
            '<Whoami>'
        )

    def test_whoami(self):
        user = datatypes.Datatype('User', {'id': '1234'})
        self.assertIsInstance(
            connections.Whoami(user).whoami(),
            ET.Element
        )

    def test_whoami_nondatatype(self):
        user = datatypes.Datatype('User', {'id': '1234'}).tostring()
        with self.assertRaises(Exception):
            connections.Whoami(user)

    def test_whoami_nonuser(self):
        customer = datatypes.Datatype('Customer', {'id': '1234'})
        with self.assertRaises(Exception):
            connections.Whoami(customer)

    def test_tostring_user(self):
        user = datatypes.Datatype('User', {'id': '1234'})
        self.assertEqual(
            connections.Whoami(user).tostring(),
            b'<Whoami><User><id>1234</id></User></Whoami>'
        )

    def test_prettify(self):
        user = datatypes.Datatype('User', {'id': '1234'})
        self.assertEqual(

# 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: tests/connections/test_whoami.py
import unittest
    import xml.etree.cElementTree as ET
    import xml.etree.ElementTree as ET
from oaxmlapi import connections, datatypes

            '<Whoami>'
        )

    def test_whoami(self):
        user = datatypes.Datatype('User', {'id': '1234'})
        self.assertIsInstance(
            connections.Whoami(user).whoami(),
            ET.Element
        )

    def test_whoami_nondatatype(self):
        user = datatypes.Datatype('User', {'id': '1234'}).tostring()
        with self.assertRaises(Exception):
            connections.Whoami(user)

    def test_whoami_nonuser(self):
        customer = datatypes.Datatype('Customer', {'id': '1234'})
        with self.assertRaises(Exception):
            connections.Whoami(customer)

    def test_tostring_user(self):
        user = datatypes.Datatype('User', {'id': '1234'})
        self.assertEqual(
            connections.Whoami(user).tostring(),
            b'<Whoami><User><id>1234</id></User></Whoami>'
        )

    def test_prettify(self):
        user = datatypes.Datatype('User', {'id': '1234'})
        self.assertEqual(

            connections.Whoami(user).prettify(),