[ 
https://issues.apache.org/jira/browse/BEAM-5320?focusedWorklogId=151356&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-151356
 ]

ASF GitHub Bot logged work on BEAM-5320:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Oct/18 20:25
            Start Date: 04/Oct/18 20:25
    Worklog Time Spent: 10m 
      Work Description: aaltay closed pull request #6572: [BEAM-5320] Partially 
port testing
URL: https://github.com/apache/beam/pull/6572
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdks/python/apache_beam/testing/pipeline_verifiers_test.py 
b/sdks/python/apache_beam/testing/pipeline_verifiers_test.py
index dd7cf6d8de2..0cce915f58c 100644
--- a/sdks/python/apache_beam/testing/pipeline_verifiers_test.py
+++ b/sdks/python/apache_beam/testing/pipeline_verifiers_test.py
@@ -92,7 +92,7 @@ def test_pipeline_state_matcher_fails(self):
 
   def create_temp_file(self, content, directory=None):
     with tempfile.NamedTemporaryFile(delete=False, dir=directory) as f:
-      f.write(content)
+      f.write(content.encode('utf-8'))
       return f.name
 
   def test_file_checksum_matcher_success(self):
@@ -133,7 +133,7 @@ def test_file_checksum_matchcer_invalid_sleep_time(self):
     self.assertEqual(cm.exception.args[0],
                      'Sleep seconds, if received, must be int. '
                      'But received: \'invalid_sleep_time\', '
-                     '<type \'str\'>')
+                     '{}'.format(str))
 
   @patch('time.sleep', return_value=None)
   def test_file_checksum_matcher_sleep_before_verify(self, mocked_sleep):
diff --git a/sdks/python/apache_beam/testing/test_utils.py 
b/sdks/python/apache_beam/testing/test_utils.py
index 6ca75e65102..490d0792715 100644
--- a/sdks/python/apache_beam/testing/test_utils.py
+++ b/sdks/python/apache_beam/testing/test_utils.py
@@ -81,7 +81,7 @@ def compute_hash(content, hashing_alg=DEFAULT_HASHING_ALG):
   content.sort()
   m = hashlib.new(hashing_alg)
   for elem in content:
-    m.update(str(elem))
+    m.update(str(elem).encode('utf-8'))
   return m.hexdigest()
 
 
diff --git a/sdks/python/apache_beam/testing/test_utils_test.py 
b/sdks/python/apache_beam/testing/test_utils_test.py
index 56df9fe091a..bef40786016 100644
--- a/sdks/python/apache_beam/testing/test_utils_test.py
+++ b/sdks/python/apache_beam/testing/test_utils_test.py
@@ -74,13 +74,13 @@ def test_temp_file_field_correct(self):
     with utils.TempDir() as tempdir:
       filename = tempdir.create_temp_file(
           suffix='.txt',
-          lines=['line1\n', 'line2\n', 'line3\n'])
+          lines=[b'line1\n', b'line2\n', b'line3\n'])
       self.assertTrue(filename.endswith('.txt'))
 
       with open(filename, 'rb') as f:
-        self.assertEqual(f.readline(), 'line1\n')
-        self.assertEqual(f.readline(), 'line2\n')
-        self.assertEqual(f.readline(), 'line3\n')
+        self.assertEqual(f.readline(), b'line1\n')
+        self.assertEqual(f.readline(), b'line2\n')
+        self.assertEqual(f.readline(), b'line3\n')
 
   @mock.patch('time.sleep', return_value=None)
   def test_wait_for_subscriptions_created_fails(self, patched_time_sleep):


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 151356)
    Time Spent: 0.5h  (was: 20m)

> Finish Python 3 porting for testing module
> ------------------------------------------
>
>                 Key: BEAM-5320
>                 URL: https://issues.apache.org/jira/browse/BEAM-5320
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Robbe
>            Assignee: Stijn Decubber
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to