コード例 #1
0
    def test_past_as_importlist_1(self):
        """Test past as importlist with TEST_MODULE_1"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_1)

        printer = Printer(moddict, indent_size=2)
        importlist = printer['ImportList']
        print(importlist)
        self.assertEqual('\n' + importlist, TEST_MODULE_4_REF)
コード例 #2
0
    def test_past_as_doctable_3(self):
        """Test past as doctable with TEST_MODULE_3"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_3)

        printer = Printer(moddict, indent_size=2)
        doctable = printer['DocTable']

        self.assertEqual(doctable, TEST_MODULE_3_REF)
コード例 #3
0
    def test_past_as_initwire_4(self):
        """Test past as initwire with TEST_MODULE_4"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_4)

        printer = Printer(moddict, indent_size=2)
        initwire = printer['InitWire']

        self.assertEqual('\n' + initwire, TEST_MODULE_4_REF)
コード例 #4
0
    def test_past_as_signals_4(self):
        """Test past as signals with TEST_MODULE_4"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_4)

        printer = Printer(moddict, indent_size=2)
        signals = printer['Signals']

        self.assertEqual('\n' + signals, TEST_MODULE_4_REF)
コード例 #5
0
    def test_past_as_parameters_2(self):
        """Test past as parameters with TEST_MODULE_2"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_2)

        printer = Printer(moddict, indent_size=2)
        parameters = printer['Parameters']

        self.assertEqual('\n' + parameters, TEST_MODULE_2_REF)
コード例 #6
0
    def test_past_as_module_4(self):
        """Test past as module with TEST_MODULE_4"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_4)

        printer = Printer(moddict, indent_size=3)
        module = printer['Module']

        self.assertEqual('\n' + module, TEST_MODULE_4_REF)
コード例 #7
0
    def test_past_as_wavedisp_4(self):
        """Test past as wavedisp with TEST_MODULE_4"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_4)

        printer = Printer(moddict, indent_size=3)
        wavedisp = printer['Wavedisp']

        self.assertEqual('\n' + wavedisp, TEST_MODULE_4_REF)
コード例 #8
0
    def test_past_as_instance_4_instance_name(self):
        """Test past as instance with TEST_MODULE_4"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_4)

        printer = Printer(moddict, indent_size=2, instance_name='new_name')
        instance = printer['Instance']

        self.assertEqual('\n' + instance, TEST_MODULE_4_INSTANCE_NAME_REF)
コード例 #9
0
    def test_past_as_instance_3(self):
        """Test past as instance with TEST_MODULE_3"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_3)

        printer = Printer(moddict, indent_size=2)
        instance = printer['Instance']

        self.assertEqual('\n' + instance, TEST_MODULE_3_REF)
コード例 #10
0
    def test_past_as_logic_4(self):
        """Test past as logic with TEST_MODULE_4"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_4)

        printer = Printer(moddict, indent_size=2)
        logic = printer['Logic']

        self.assertEqual('\n' + logic, TEST_MODULE_4_REF)
コード例 #11
0
    def test_past_as_clockingblock_2(self):
        """Test past as clockingblock with TEST_MODULE_2"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_2)

        printer = Printer(moddict, indent_size=2)
        clockingblock = printer['ClockingBlock']

        self.assertEqual('\n' + clockingblock, TEST_MODULE_2_REF)
コード例 #12
0
    def test_past_as_initlatch_2(self):
        """Test past as initlatch with TEST_MODULE_2"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_2)

        printer = Printer(moddict, indent_size=2)
        initlatch = printer['InitLatch']

        self.assertEqual('\n' + initlatch, TEST_MODULE_2_REF)
コード例 #13
0
    def test_past_as_modulename_4(self):
        """Test past as modulename with TEST_MODULE_4"""
        moddict = ModDict()
        moddict.parse(inputs.TEST_MODULE_4)

        printer = Printer(moddict, indent_size=2)
        modulename = printer['ModuleName']

        print(modulename)
        self.assertEqual(modulename, TEST_MODULE_4_REF)