Back to index

obnam  1.1
Public Member Functions | Public Attributes
obnamlib.hooks_tests.FilterHookTests Class Reference

List of all members.

Public Member Functions

def setUp
def test_add_filter_ok
def test_never_filter_no_tags
def test_never_filter_clean_revert
def test_base64_filter_encode
def test_base64_filter_decode
def test_missing_filter_raises
def test_missing_filter_gives_tag
def test_can_remove_filters
def test_call_callbacks_raises

Public Attributes

 hook

Detailed Description

Definition at line 107 of file hooks_tests.py.


Member Function Documentation

Definition at line 109 of file hooks_tests.py.

00109 
00110     def setUp(self):
00111         self.hook = obnamlib.FilterHook()

Definition at line 112 of file hooks_tests.py.

00112 
00113     def test_add_filter_ok(self):
00114         self.hook.add_callback(NeverAddsFilter())

Definition at line 127 of file hooks_tests.py.

00127 
00128     def test_base64_filter_decode(self):
00129         self.hook.add_callback(Base64Filter())
00130         self.assertEquals(self.hook.run_filter_read("base64\0AE9L"), "OK")

Definition at line 123 of file hooks_tests.py.

00123 
00124     def test_base64_filter_encode(self):
00125         self.hook.add_callback(Base64Filter())
00126         self.assertEquals(self.hook.run_filter_write("OK"), "base64\0AE9L")

Definition at line 147 of file hooks_tests.py.

00147 
00148     def test_call_callbacks_raises(self):
00149         self.assertRaises(NotImplementedError, self.hook.call_callbacks, "")

Definition at line 141 of file hooks_tests.py.

00141 
00142     def test_can_remove_filters(self):
00143         myfilter = NeverAddsFilter()
00144         filterid = self.hook.add_callback(myfilter)
00145         self.hook.remove_callback(filterid)
00146         self.assertEquals(self.hook.callbacks, [])

Definition at line 135 of file hooks_tests.py.

00135 
00136     def test_missing_filter_gives_tag(self):
00137         try:
00138             self.hook.run_filter_read("missing\0")
00139         except obnamlib.MissingFilterError, e:
00140             self.assertEquals(e.tagname, "missing")

Definition at line 131 of file hooks_tests.py.

00131 
00132     def test_missing_filter_raises(self):
00133         self.assertRaises(obnamlib.MissingFilterError,
00134                           self.hook.run_filter_read, "missing\0")

Definition at line 119 of file hooks_tests.py.

00119 
00120     def test_never_filter_clean_revert(self):
00121         self.hook.add_callback(NeverAddsFilter())
00122         self.assertEquals(self.hook.run_filter_read("\0foo"), "foo")

Definition at line 115 of file hooks_tests.py.

00115 
00116     def test_never_filter_no_tags(self):
00117         self.hook.add_callback(NeverAddsFilter())
00118         self.assertEquals(self.hook.run_filter_write("foo"), "\0foo")
        

Member Data Documentation

Definition at line 110 of file hooks_tests.py.


The documentation for this class was generated from the following file: