Skip to content

Commit

Permalink
initial unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
atlas0fd00m committed Apr 3, 2019
1 parent f642745 commit b90c174
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Binary file added tests/.test_basics.py.un~
Binary file not shown.
Empty file added tests/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions tests/test_basics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import unittest

class RfCatBasicTests(unittest.TestCase):

def test_importing(self):
import rflib
devs = rflib.getRfCatDevices()
self.assertEquals(type(devs), list, "rflib.getRfCatDevices() doesn't return a list!: %r" % devs)

16 changes: 16 additions & 0 deletions tests/test_basics.py~
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
import unittest

import PE
import vivisect.tests.helpers as helpers

class RfCatBasicTests(unittest.TestCase):

def test_export_by_name(self):
file_path = helpers.getTestPath('windows', 'i386', 'export_by_name.dll')
pe = PE.peFromFileName(file_path)
export_list = pe.getExports()
self.assertEquals(len(export_list), 2, "expecting 2 exported functions")
self.assertEquals(export_list[0][1], 0, "exported function with ordinal 0 not found")
self.assertEquals(export_list[0][2], "Func1", "exported function with name 'Func1' not found")

0 comments on commit b90c174

Please sign in to comment.