Skip to content

Commit

Permalink
test added to verify output assignment on category attribute, IBMStre…
Browse files Browse the repository at this point in the history
  • Loading branch information
markheger committed Apr 17, 2020
1 parent 7e00e77 commit 7e90873
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/python/topology/test2_spl_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
import unittest
import sys
import itertools
import threading

from streamsx.topology.topology import *
from streamsx.topology.tester import Tester
from streamsx.topology import schema
import streamsx.topology.context
from streamsx.topology.context import ConfigParams
import streamsx.spl.op as op


class TestSPLCategory(unittest.TestCase):
""" Test invocations of SPL operators from Python topology.
"""
_multiprocess_can_split_ = True

def setUp(self):
Tester.setup_standalone(self)

def test_attribute_category(self):
topo = Topology()
b = op.Source(topo, "spl.utility::Beacon",
'tuple<uint64 seq, rstring category>',
params = {'iterations':2})
b.seq = b.output('IterationCount()')
b.category = b.output('"category"') # b.category causes TypeError: Object of type 'Expression' is not JSON serializable
s = b.stream

tester = Tester(topo)
tester.tuple_count(s, 2)
tester.test(self.test_ctxtype, self.test_config)


0 comments on commit 7e90873

Please sign in to comment.