Example #1
0
    def test_simple_write(self):
        entries = {b'barbla': ((1230680220, 0), (1230680220, 0), 2050, 3761020,
                    33188, 1000, 1000, 0,
                    b'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391', 0)}
        filename = os.path.join(self.tempdir, 'test-simple-write-index')
        with open(filename, 'wb+') as x:
            write_index_dict(x, entries)

        with open(filename, 'rb') as x:
            self.assertEqual(entries, read_index_dict(x))
Example #2
0
    def test_simple_write(self):
        entries = {b'barbla': ((1230680220, 0), (1230680220, 0), 2050, 3761020,
                    33188, 1000, 1000, 0,
                    b'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391', 0)}
        filename = os.path.join(self.tempdir, 'test-simple-write-index')
        with open(filename, 'wb+') as x:
            write_index_dict(x, entries)

        with open(filename, 'rb') as x:
            self.assertEqual(entries, read_index_dict(x))
Example #3
0
 def test_simple_write(self):
     entries = {'barbla': ((1230680220, 0), (1230680220, 0), 2050, 3761020,
                 33188, 1000, 1000, 0,
                 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391', 0)}
     filename = os.path.join(self.tempdir, 'test-simple-write-index')
     x = open(filename, 'w+')
     try:
         write_index_dict(x, entries)
     finally:
         x.close()
     x = open(filename, 'r')
     try:
         self.assertEqual(entries, read_index_dict(x))
     finally:
         x.close()
Example #4
0
 def test_simple_write(self):
     entries = {
         'barbla':
         ((1230680220, 0), (1230680220, 0), 2050, 3761020, 33188, 1000,
          1000, 0, 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391', 0)
     }
     filename = os.path.join(self.tempdir, 'test-simple-write-index')
     x = open(filename, 'w+')
     try:
         write_index_dict(x, entries)
     finally:
         x.close()
     x = open(filename, 'r')
     try:
         self.assertEqual(entries, read_index_dict(x))
     finally:
         x.close()
Example #5
0
    def test_simple_write(self):
        entries = {
            b"barbla": (
                (1230680220, 0),
                (1230680220, 0),
                2050,
                3761020,
                33188,
                1000,
                1000,
                0,
                b"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
                0,
            )
        }
        filename = os.path.join(self.tempdir, "test-simple-write-index")
        with open(filename, "wb+") as x:
            write_index_dict(x, entries)

        with open(filename, "rb") as x:
            self.assertEqual(entries, read_index_dict(x))
Example #6
0
    def test_simple_write(self):
        entries = {
            "barbla": (
                (1230680220, 0),
                (1230680220, 0),
                2050,
                3761020,
                33188,
                1000,
                1000,
                0,
                "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
                0,
            )
        }
        filename = os.path.join(self.tempdir, "test-simple-write-index")
        with open(filename, "w+") as x:
            write_index_dict(x, entries)

        with open(filename, "r") as x:
            self.assertEqual(entries, read_index_dict(x))