def test_creation(self):
        sot = resource2._BaseComponent("name", type=int, default=1,
                                       alternate_id=True)

        self.assertEqual("name", sot.name)
        self.assertEqual(int, sot.type)
        self.assertEqual(1, sot.default)
        self.assertTrue(sot.alternate_id)
    def test_creation(self):
        sot = resource2._BaseComponent("name",
                                       type=int,
                                       default=1,
                                       alternate_id=True)

        self.assertEqual("name", sot.name)
        self.assertEqual(int, sot.type)
        self.assertEqual(1, sot.default)
        self.assertTrue(sot.alternate_id)
    def test_get_no_instance(self):
        sot = resource2._BaseComponent("test")

        # Test that we short-circuit everything when given no instance.
        result = sot.__get__(None, None)
        self.assertIsNone(result)
    def test_get_no_instance(self):
        sot = resource2._BaseComponent("test")

        # Test that we short-circuit everything when given no instance.
        result = sot.__get__(None, None)
        self.assertIsNone(result)