Repository: incubator-beam Updated Branches: refs/heads/python-sdk f166b16b8 -> 4840f5275
Use item equality in apply_to_list test Orders of PCollections are not guaranteed and this test depends on the current DirectRunner implementation for output to have the same order as input. Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/0608ad94 Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/0608ad94 Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/0608ad94 Branch: refs/heads/python-sdk Commit: 0608ad94758afe8caebb5f1d8472f89718668542 Parents: f166b16 Author: Ahmet Altay <[email protected]> Authored: Tue Jun 21 11:05:39 2016 -0700 Committer: Ahmet Altay <[email protected]> Committed: Tue Jun 21 11:05:39 2016 -0700 ---------------------------------------------------------------------- sdks/python/apache_beam/transforms/ptransform_test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/0608ad94/sdks/python/apache_beam/transforms/ptransform_test.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/transforms/ptransform_test.py b/sdks/python/apache_beam/transforms/ptransform_test.py index 401bcb4..3244473 100644 --- a/sdks/python/apache_beam/transforms/ptransform_test.py +++ b/sdks/python/apache_beam/transforms/ptransform_test.py @@ -510,14 +510,15 @@ class PTransformTest(unittest.TestCase): pipeline.run() def test_apply_to_list(self): - self.assertEqual([1, 2, 3], [0, 1, 2] | beam.Map('add_one', lambda x: x + 1)) - self.assertEqual([1], [0, 1, 2] | beam.Filter('odd', lambda x: x % 2)) - self.assertEqual([1, 2, 3, 100], - ([1, 2, 3], [100]) | beam.Flatten('flat')) + self.assertItemsEqual( + [1, 2, 3], [0, 1, 2] | beam.Map('add_one', lambda x: x + 1)) + self.assertItemsEqual([1], [0, 1, 2] | beam.Filter('odd', lambda x: x % 2)) + self.assertItemsEqual([1, 2, 100, 3], + ([1, 2, 3], [100]) | beam.Flatten('flat')) join_input = ([('k', 'a')], [('k', 'b'), ('k', 'c')]) - self.assertEqual([('k', (['a'], ['b', 'c']))], - join_input | beam.CoGroupByKey('join')) + self.assertItemsEqual([('k', (['a'], ['b', 'c']))], + join_input | beam.CoGroupByKey('join')) def test_multi_input_ptransform(self): class DisjointUnion(PTransform):
