Patchwork [hglib] tests: fix test-summary for python3

login
register
mail settings
Submitter Julien Cristau
Date Sept. 1, 2015, 9:59 a.m.
Message ID <dbb21a4c0eb914b454aa.1441101545@sh76.dev.logilab.fr>
Download mbox | patch
Permalink /patch/10340/
State Accepted
Headers show

Comments

Julien Cristau - Sept. 1, 2015, 9:59 a.m.
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1441094863 -7200
#      Tue Sep 01 10:07:43 2015 +0200
# Node ID dbb21a4c0eb914b454aa461a7e70504239bbc6ba
# Parent  568bca4ff58e0ac906091e3b066966562bdf5753
tests: fix test-summary for python3

We get back bytes, not str.  Sorry about that.
Matt Mackall - Sept. 1, 2015, 8:14 p.m.
On Tue, 2015-09-01 at 11:59 +0200, Julien Cristau wrote:
> # HG changeset patch
> # User Julien Cristau <julien.cristau@logilab.fr>
> # Date 1441094863 -7200
> #      Tue Sep 01 10:07:43 2015 +0200
> # Node ID dbb21a4c0eb914b454aa461a7e70504239bbc6ba
> # Parent  568bca4ff58e0ac906091e3b066966562bdf5753
> tests: fix test-summary for python3

Thanks, queued.

Patch

diff --git a/tests/test-summary.py b/tests/test-summary.py
--- a/tests/test-summary.py
+++ b/tests/test-summary.py
@@ -18,11 +18,11 @@  class test_summary(common.basetest):
         d = {b('parent') : [(0, node[:12], b('tip'), b('first'))],
              b('branch') : b('default'),
              b('commit') : True,
              b('update') : 0}
         if self.client.version >= (3, 5):
-            d[b('phases')] = '1 draft'
+            d[b('phases')] = b('1 draft')
 
         self.assertEquals(self.client.summary(), d)
 
     def test_commit_dirty(self):
         self.append('a', 'a')
@@ -32,11 +32,11 @@  class test_summary(common.basetest):
         d = {b('parent') : [(0, node[:12], b('tip'), b('first'))],
              b('branch') : b('default'),
              b('commit') : False,
              b('update') : 0}
         if self.client.version >= (3, 5):
-            d[b('phases')] = '1 draft'
+            d[b('phases')] = b('1 draft')
 
         self.assertEquals(self.client.summary(), d)
 
     def test_update(self):
         self.append('a', 'a')
@@ -48,11 +48,11 @@  class test_summary(common.basetest):
         d = {b('parent') : [(0, node[:12], None, b('first'))],
              b('branch') : b('default'),
              b('commit') : True,
              b('update') : 1}
         if self.client.version >= (3, 5):
-            d[b('phases')] = '2 draft'
+            d[b('phases')] = b('2 draft')
 
         self.assertEquals(self.client.summary(), d)
 
     def test_remote(self):
         self.append('a', 'a')
@@ -95,11 +95,11 @@  class test_summary(common.basetest):
             tags = b('tip bmother')
         else:
             tags = b('tip')
         d[b('parent')] = [(1, node[:12], tags, b('second in other'))]
         if self.client.version >= (3, 5):
-            d[b('phases')] = '1 draft'
+            d[b('phases')] = b('1 draft')
 
         self.assertEquals(other.summary(remote=True), d)
 
     def test_two_parents(self):
         self.append('a', 'a')
@@ -118,8 +118,8 @@  class test_summary(common.basetest):
                          (1, node1[:12], None, b('second'))],
              b('branch') : b('default'),
              b('commit') : False,
              b('update') : 0}
         if self.client.version >= (3, 5):
-            d[b('phases')] = '3 draft'
+            d[b('phases')] = b('3 draft')
 
         self.assertEquals(self.client.summary(), d)