def test_filter_no_dictionary(self): """ Asserts that dictionary is filtered properly. """ test_keys = ['one', 'two'] filtered = utils.filter_dictionary(None, test_keys) self.assertEquals(filtered, dict())
def test_filter_no_keys(self): """ Asserts that dictionary is filtered properly. """ test_dict = dict(one='test1', two='test2', three='test3') filtered = utils.filter_dictionary(test_dict, None) self.assertEquals(filtered, dict())
def test_filter_dictionary(self): """ Asserts that dictionary is filtered properly. """ test_dict = dict(one='test1', two='test2', three='test3') test_keys = ['one', 'two'] filtered = utils.filter_dictionary(test_dict, test_keys) self.assertNotIn('three', filtered.keys())