Skip to content

Commit

Permalink
Cleanup; better test file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
disconnect3d committed Apr 3, 2018
1 parent c096275 commit 7a11bad
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 13 deletions.
1 change: 0 additions & 1 deletion pwndbg/commands/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import pwndbg.auxv
import pwndbg.commands
import pwndbg.regs
import pwndbg.services
import pwndbg.symbol

_errno.errorcode[0] = 'OK'
Expand Down
Empty file removed pwndbg/services/__init__.py
Empty file.
1 change: 0 additions & 1 deletion pwndbg/services/misc.py.bak

This file was deleted.

6 changes: 6 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from . import binaries
13 changes: 13 additions & 0 deletions tests/binaries/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import os

from . import old_bash

path = os.path.dirname(__file__)

def get(x):
return os.path.join(path, x)
12 changes: 9 additions & 3 deletions pwndbg/services/misc.py → tests/binaries/old_bash/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import pwndbg.commands

import os

path = os.path.dirname(__file__)

def get(x):
return os.path.join(path, x)
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""
This file should consist of global test fixtures.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import gdb
import pytest

Expand Down
12 changes: 7 additions & 5 deletions tests/test_loads.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import codecs
import re
import subprocess
import tempfile

import tests


def run_gdb_with_script(binary='', core='', pybefore=None, pyafter=None):
"""
Expand Down Expand Up @@ -57,8 +59,8 @@ def run_gdb_with_script(binary='', core='', pybefore=None, pyafter=None):
return output


BASH_BIN = './tests/corefiles/bash/binary'
BASH_CORE = './tests/corefiles/bash/core'
BASH_BIN = tests.binaries.old_bash.get('binary')
BASH_CORE = tests.binaries.old_bash.get('core')


def test_loads_pure_gdb_without_crashing():
Expand Down
1 change: 0 additions & 1 deletion tests/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ def test_memory_read_write(entry_binary):
val = bytes('Z' * 8, 'utf8')
pwndbg.memory.write(stack_addr, val)
assert pwndbg.memory.read(stack_addr, len(val)+4) == bytearray('Z'*8 + 'YYXX', 'utf8')

0 comments on commit 7a11bad

Please sign in to comment.