# Copyright (c) 2009 The PyAMF Project.
# See LICENSE.txt for details.

"""
Tests for L{ClassAlias} and L{register_class}. Both are the most
fundamental parts of PyAMF and the test suite for it is big so it makes sense
to have them in one file.

@since: 0.5
"""

import unittest

import pyamf
from pyamf import ClassAlias
from pyamf.tests.util import ClassCacheClearingTestCase, Spam, get_fqcn

try:
    set
except NameError:
    from sets import Set as set


class ClassAliasTestCase(ClassCacheClearingTestCase):
    """
    Test all functionality relating to the class L{ClassAlias}.
    """

    def test_init(self):
        x = ClassAlias(Spam)

        self.assertTrue(x.anonymous)
        self.assertTrue(x.dynamic)
        self.assertFalse(x.amf3)
        self.assertFalse(x.external)

        self.assertEquals(x.readonly_attrs, None)