Skip to content

Commit

Permalink
Make the unicode tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Oct 26, 2017
1 parent daa150f commit 4d85a0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions px/px_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ def get_sudo_user(self):

class PxProcessBuilder(object):
def __init__(self):
self.cmdline = None # type: str
self.cmdline = None # type: unicode
self.pid = None # type: int
self.ppid = None # type: int
self.start_time_string = None # type: str
self.username = None # type: str
self.start_time_string = None # type: unicode
self.username = None # type: unicode
self.cpu_time = None # type: float
self.memory_percent = None # type: float

Expand Down Expand Up @@ -216,10 +216,10 @@ def create_kernel_process(now):
# FIXME: This should be the system boot timestamp, not the epoch
process_builder.start_time_string = datetime.datetime.utcfromtimestamp(0).strftime("%c")

process_builder.username = "root"
process_builder.username = u"root"
process_builder.cpu_time = None
process_builder.memory_percent = None
process_builder.cmdline = "kernel PID 0"
process_builder.cmdline = u"kernel PID 0"
process = PxProcess(process_builder, now)

process.children = set()
Expand Down
2 changes: 1 addition & 1 deletion tests/px_terminal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_to_screen_lines_unbounded():


def test_to_screen_lines_unicode():
procs = [testutils.create_process(commandline="/usr/bin/😀")]
procs = [testutils.create_process(commandline=u"/usr/bin/😀")]
converted = px_terminal.to_screen_lines(procs, None)
if sys.version_info.major > 3:
assert converted == [
Expand Down

0 comments on commit 4d85a0b

Please sign in to comment.