Ejemplo n.º 1
0
    def test_get_header_existing(self):
        """
        """
        header_templ = "GNU tar-1.20-2\n1232387353\x00128841398\x00"

        snpf = SnapshotFile(self.snarfile)
        header = snpf.getHeader()
        self.assertEqual(header_templ, header)
Ejemplo n.º 2
0
    def test_create_SnapshotFile_newfile(self):
        """Instantiation of SnapshotFile with creation of SNAR-file.
        """
        header_templ = None
        version_templ = int(0)

        snpf = SnapshotFile(self.snarf_new, writeFlag = True)
        header = snpf.getHeader()
        self.assertEqual(header_templ, header)
        version = snpf.getFormatVersion()
        self.assertEqual(version_templ, version)
Ejemplo n.º 3
0
    def test_header_newfile(self):
        """Test methods related to header on fresh created file.
        """
        header_templ = "GNU tar-1.19-2\n1169216967\x001169216967\x00"
        version_templ = int(2)
        datet = datetime.datetime(2007, 1, 19, 15, 29, 27)

        snpf = SnapshotFile(self.snarf_new, writeFlag = True)
        snpf.setHeader(datet)

        header = snpf.getHeader()
        self.assertEqual(header_templ, header)
        version = snpf.getFormatVersion()
        self.assertEqual(version_templ, version)