Back to index

obnam  1.1
Public Member Functions | Public Attributes
obnamlib.forget_policy_tests.ForgetPolicyParseTests Class Reference

List of all members.

Public Member Functions

def setUp
def test_raises_error_for_empty_string
def test_raises_error_for_unknown_period
def test_raises_error_if_period_is_duplicated
def test_raises_error_rules_not_separated_by_comma
def test_parses_single_rule
def test_parses_multiple_rules

Public Attributes

 fp

Detailed Description

Definition at line 23 of file forget_policy_tests.py.


Member Function Documentation

Definition at line 25 of file forget_policy_tests.py.

00025 
00026     def setUp(self):
00027         self.fp = obnamlib.ForgetPolicy()

Definition at line 48 of file forget_policy_tests.py.

00048 
00049     def test_parses_multiple_rules(self):
00050         self.assertEqual(self.fp.parse('1h,2d,3w,4m,255y'),
00051                          { 'hourly': 1,
00052                            'daily': 2,
00053                            'weekly': 3,
00054                            'monthly': 4,
00055                            'yearly': 255 })
00056 

Definition at line 40 of file forget_policy_tests.py.

00040 
00041     def test_parses_single_rule(self):
00042         self.assertEqual(self.fp.parse('7d'),
00043                          { 'hourly': 0,
00044                            'daily': 7,
00045                            'weekly': 0,
00046                            'monthly': 0,
00047                            'yearly': 0 })

Definition at line 28 of file forget_policy_tests.py.

00028 
00029     def test_raises_error_for_empty_string(self):
00030         self.assertRaises(obnamlib.Error, self.fp.parse, '')

Definition at line 31 of file forget_policy_tests.py.

00031 
00032     def test_raises_error_for_unknown_period(self):
00033         self.assertRaises(obnamlib.Error, self.fp.parse, '7x')

Definition at line 34 of file forget_policy_tests.py.

00034 
00035     def test_raises_error_if_period_is_duplicated(self):
00036         self.assertRaises(obnamlib.Error, self.fp.parse, '1h,2h')

Definition at line 37 of file forget_policy_tests.py.

00037 
00038     def test_raises_error_rules_not_separated_by_comma(self):
00039         self.assertRaises(obnamlib.Error, self.fp.parse, '1h 2d')


Member Data Documentation

Definition at line 26 of file forget_policy_tests.py.


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