@@ -0,0 +1,2450 @@
+#%0A# Licensed to the Apache Software Foundation (ASF) under one or more%0A# contributor license agreements.  See the NOTICE file distributed with%0A# this work for additional information regarding copyright ownership.%0A# The ASF licenses this file to You under the Apache License, Version 2.0%0A# (the %22License%22); you may not use this file except in compliance with%0A# the License.  You may obtain a copy of the License at%0A#%0A#    http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A#%0A%0A%22%22%22Unit tests for the windowed_value.%22%22%22%0A%0Aimport copy%0Aimport pickle%0Aimport unittest%0A%0Afrom apache_beam.utils import windowed_value%0Afrom apache_beam.transforms.timeutil import Timestamp%0A%0A%0Aclass WindowedValueTest(unittest.TestCase):%0A%0A  def test_timestamps(self):%0A    wv = windowed_value.WindowedValue(None, 3, ())%0A    self.assertEqual(wv.timestamp, Timestamp.of(3))%0A    self.assertTrue(wv.timestamp is wv.timestamp)%0A    self.assertEqual(windowed_value.WindowedValue(None, -2.5, ()).timestamp,%0A                     Timestamp.of(-2.5))%0A%0A  def test_with_value(self):%0A    wv = windowed_value.WindowedValue(1, 3, ())%0A    self.assertEqual(wv.with_value(10), windowed_value.WindowedValue(10, 3, ()))%0A%0A  def test_equality(self):%0A    self.assertEqual(%0A        windowed_value.WindowedValue(1, 3, ()),%0A        windowed_value.WindowedValue(1, 3, ()))%0A    self.assertNotEqual(%0A        windowed_value.WindowedValue(1, 3, ()),%0A        windowed_value.WindowedValue(100, 3, ()))%0A    self.assertNotEqual(%0A        windowed_value.WindowedValue(1, 3, ()),%0A        windowed_value.WindowedValue(1, 300, ()))%0A    self.assertNotEqual(%0A        windowed_value.WindowedValue(1, 3, ()),%0A        windowed_value.WindowedValue(1, 300, ((),)))%0A%0A    self.assertNotEqual(%0A        windowed_value.WindowedValue(1, 3, ()),%0A        object())%0A%0A  def test_hash(self):%0A    wv = windowed_value.WindowedValue(1, 3, ())%0A    wv_copy = copy.copy(wv)%0A    self.assertFalse(wv is wv_copy)%0A    self.assertEqual(%7Bwv: 100%7D.get(wv_copy), 100)%0A%0A  def test_pickle(self):%0A    wv = windowed_value.WindowedValue(1, 3, ())%0A    self.assertTrue(pickle.loads(pickle.dumps(wv)) == wv)%0A%0A%0Aif __name__ == '__main__':%0A  unittest.main()%0A

Add tests for WindowedValue.