forked from IBMStreams/streamsx.topology
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test added to verify output assignment on category attribute, IBMStre…
- Loading branch information
markheger
committed
Apr 17, 2020
1 parent
7e00e77
commit 7e90873
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|