| 1 |
__author__ = "Rick Sherman" |
| 2 |
__credits__ = "Jeremy Schulman" |
| 3 |
|
| 4 |
import unittest |
| 5 |
import nose2 |
| 6 |
|
| 7 |
from jnpr.junos.factory.factory_cls import FactoryCfgTable, FactoryOpTable |
| 8 |
from jnpr.junos.factory.factory_cls import FactoryTable, FactoryView |
| 9 |
|
| 10 |
|
| 11 |
class TestFactoryCls(unittest.TestCase): |
| 12 |
def test_factory_cls_cfgtable(self): |
| 13 |
t = FactoryCfgTable() |
| 14 |
self.assertEqual(t.__module__, "jnpr.junos.factory.CfgTable") |
| 15 |
|
| 16 |
def test_factory_cls_optable(self): |
| 17 |
t = FactoryOpTable("test") |
| 18 |
self.assertEqual(t.__module__, "jnpr.junos.factory.OpTable") |
| 19 |
|
| 20 |
def test_factory_cls_factorytable(self): |
| 21 |
t = FactoryTable("test") |
| 22 |
self.assertEqual(t.__module__, "jnpr.junos.factory.Table") |
| 23 |
|
| 24 |
def test_factory_cls_factoryview(self): |
| 25 |
x = FactoryCfgTable() |
| 26 |
x.FIELDS = {"test": "test"} |
| 27 |
x.GROUPS = x.FIELDS |
| 28 |
t = FactoryView(x.FIELDS, extends=x, groups=x.FIELDS) |
| 29 |
self.assertEqual(t.__module__, "jnpr.junos.factory.View") |