Back to index

obnam  1.1
Public Member Functions
obnamlib.metadata_tests.MetadataTests Class Reference

List of all members.

Public Member Functions

def test_sets_mtime_from_kwarg
def test_isdir_returns_false_for_regular_file
def test_isdir_returns_true_for_directory
def test_isdir_returns_false_when_st_mode_is_not_set
def test_islink_returns_false_for_regular_file
def test_islink_returns_true_for_symlink
def test_islink_returns_false_when_st_mode_is_not_set
def test_isfile_returns_true_for_regular_file
def test_isfile_returns_false_when_st_mode_is_not_set
def test_has_no_md5_by_default
def test_sets_md5
def test_is_equal_to_itself
def test_less_than_works
def test_greater_than_works

Detailed Description

Definition at line 67 of file metadata_tests.py.


Member Function Documentation

Definition at line 122 of file metadata_tests.py.

00122 
00123     def test_greater_than_works(self):
00124         m1 = obnamlib.Metadata(st_size=1)
00125         m2 = obnamlib.Metadata(st_size=2)
00126         self.assert_(m2 > m1)
00127 

Definition at line 105 of file metadata_tests.py.

00105 
00106     def test_has_no_md5_by_default(self):
00107         metadata = obnamlib.Metadata()
00108         self.assertEqual(metadata.md5, None)

Definition at line 113 of file metadata_tests.py.

00113 
00114     def test_is_equal_to_itself(self):
00115         metadata = obnamlib.Metadata(st_mode=stat.S_IFREG)
00116         self.assertEqual(metadata, metadata)

Definition at line 73 of file metadata_tests.py.

00073 
00074     def test_isdir_returns_false_for_regular_file(self):
00075         metadata = obnamlib.Metadata(st_mode=stat.S_IFREG)
00076         self.assertFalse(metadata.isdir())

Definition at line 81 of file metadata_tests.py.

00081 
00082     def test_isdir_returns_false_when_st_mode_is_not_set(self):
00083         metadata = obnamlib.Metadata()
00084         self.assertFalse(metadata.isdir())

Definition at line 77 of file metadata_tests.py.

00077 
00078     def test_isdir_returns_true_for_directory(self):
00079         metadata = obnamlib.Metadata(st_mode=stat.S_IFDIR)
00080         self.assert_(metadata.isdir())

Definition at line 101 of file metadata_tests.py.

00101 
00102     def test_isfile_returns_false_when_st_mode_is_not_set(self):
00103         metadata = obnamlib.Metadata()
00104         self.assertFalse(metadata.isfile())

Definition at line 97 of file metadata_tests.py.

00097 
00098     def test_isfile_returns_true_for_regular_file(self):
00099         metadata = obnamlib.Metadata(st_mode=stat.S_IFREG)
00100         self.assert_(metadata.isfile())

Definition at line 85 of file metadata_tests.py.

00085 
00086     def test_islink_returns_false_for_regular_file(self):
00087         metadata = obnamlib.Metadata(st_mode=stat.S_IFREG)
00088         self.assertFalse(metadata.islink())

Definition at line 93 of file metadata_tests.py.

00093 
00094     def test_islink_returns_false_when_st_mode_is_not_set(self):
00095         metadata = obnamlib.Metadata()
00096         self.assertFalse(metadata.islink())

Definition at line 89 of file metadata_tests.py.

00089 
00090     def test_islink_returns_true_for_symlink(self):
00091         metadata = obnamlib.Metadata(st_mode=stat.S_IFLNK)
00092         self.assert_(metadata.islink())

Definition at line 117 of file metadata_tests.py.

00117 
00118     def test_less_than_works(self):
00119         m1 = obnamlib.Metadata(st_size=1)
00120         m2 = obnamlib.Metadata(st_size=2)
00121         self.assert_(m1 < m2)

Definition at line 109 of file metadata_tests.py.

00109 
00110     def test_sets_md5(self):
00111         metadata = obnamlib.Metadata(md5='checksum')
00112         self.assertEqual(metadata.md5, 'checksum')

Definition at line 69 of file metadata_tests.py.

00069 
00070     def test_sets_mtime_from_kwarg(self):
00071         metadata = obnamlib.Metadata(st_mtime_sec=123)
00072         self.assertEqual(metadata.st_mtime_sec, 123)


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