Skip to content

Commit

Permalink
TASK: Add test for Dictwrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
d-Rickyy-b committed Feb 21, 2019
1 parent 37d4db1 commit e738b2b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pastepwn/util/dictwrapper_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
import unittest
from unittest import mock

from pastepwn.util.dictwrapper import DictWrapper


class TestDictwrapper(unittest.TestCase):
def setUp(self):
self.test_dict = {"key1": "value1", "key2": "value2"}
self.obj = mock.Mock()

def test_existing_key(self):
test_wrapped = DictWrapper(self.test_dict)
self.assertEqual(test_wrapped["key1"], "value1")

def test_non_existing_key(self):
test_wrapped = DictWrapper(self.test_dict)
self.assertEqual(test_wrapped["key3"], "{key3}")


if __name__ == '__main__':
unittest.main()

0 comments on commit e738b2b

Please sign in to comment.