Пример #1
0
    def test_single_create_untyped(self):
        expr = create('Sample.Untyped', {"arg": 1})

        expected = [CommandPayload(
            party=SOME_PARTY,
            ledger_id=DEFAULTS.default_ledger_id,
            workflow_id=DEFAULTS.default_workflow_id,
            application_id=DEFAULTS.default_application_id,
            command_id=DEFAULTS.default_command_id,
            commands=[CreateCommand(UnresolvedTypeReference('Sample.Untyped'), dict(arg=1))]
        )]
        actual = CommandBuilder.coerce(expr).build(DEFAULTS)

        assert expected == actual
    def test_single_create_untyped(self):
        expr = create('Sample.Untyped', {"arg": 1})

        expected = [CommandPayload(
            party=SOME_PARTY,
            ledger_id=DEFAULTS.default_ledger_id,
            workflow_id=DEFAULTS.default_workflow_id,
            application_id=DEFAULTS.default_application_id,
            command_id=DEFAULTS.default_command_id,
            ledger_effective_time=DEFAULT_NOW,
            maximum_record_time=DEFAULT_MRT,
            commands=[CreateCommand(UnresolvedTypeReference('Sample.Untyped'), dict(arg=1))]
        )]
        actual = CommandBuilder.coerce(expr).build(DEFAULTS, DEFAULT_NOW)

        self.assertEqual(expected, actual)