Example #1
0
def test_render_list_of_contract_type_con_old():
    from dazl.model.types import ContractIdType, ListType, ModuleRef, TypeReference

    module_ref = ModuleRef(package_id='00000000000000000000000000000000',
                           module_name=('ABC', ))
    type_ref = TypeReference(module=module_ref, name=('DefGhi', ))
    type_ = ListType(ContractIdType(type_ref))

    expected = '[ContractId ABC:DefGhi]'
    actual = str(type_)

    assert expected == actual
Example #2
0
    def test_render_update_of_contract_type_con_old(self):
        from dazl.model.types import ContractIdType, UpdateType, ModuleRef, TypeReference

        module_ref = ModuleRef(package_id='00000000000000000000000000000000',
                               module_name=('ABC', ))
        type_ref = TypeReference(module=module_ref, name=('DefGhi', ))
        type_ = UpdateType(ContractIdType(type_ref))

        expected = 'Update (ContractId ABC:DefGhi)'
        actual = str(type_)

        self.assertEqual(expected, actual)
def test_render_update_of_contract_type_con_old():
    from dazl.model.types import ContractIdType, UpdateType, ModuleRef, TypeReference

    module_ref = ModuleRef(
        package_id=PackageRef('00000000000000000000000000000000'),
        module_name=DottedName(('ABC', )))
    type_ref = TypeReference(
        con=TypeConName(module=module_ref, name=('DefGhi', )))
    type_ = UpdateType(ContractIdType(type_ref))

    expected = 'Update (ContractId ABC:DefGhi)'
    actual = str(type_)

    assert expected == actual