예제 #1
0
    def test_disc_numbers(self):
        di = DiscInfo()
        di.timestamp = 1386856788.124593
        di.description = "Fedora 20"
        di.arch = "x86_64"
        di.disc_numbers = [1, "2", 3]
        di.dump(self.path)

        self._test_identity(di)
예제 #2
0
    def test_all(self):
        di = DiscInfo()
        di.now()
        di.description = "Fedora 20"
        di.arch = "x86_64"
        di.disc_numbers = ["ALL"]
        di.dump(self.path)

        self._test_identity(di)
예제 #3
0
    def test_disc_numbers(self):
        di = DiscInfo()
        di.timestamp = 1386856788.124593
        di.description = "Fedora 20"
        di.arch = "x86_64"
        di.disc_numbers = [1, "2", 3]
        di.dump(self.path)

        self._test_identity(di)
예제 #4
0
    def test_all(self):
        di = DiscInfo()
        di.now()
        di.description = "Fedora 20"
        di.arch = "x86_64"
        di.disc_numbers = ["ALL"]
        di.dump(self.path)

        self._test_identity(di)
예제 #5
0
    def _test_identity(self, di):
        first = os.path.join(self.tmp_dir, "first")
        second = os.path.join(self.tmp_dir, "second")

        # write original file
        di.dump(first)

        # read file and write it back
        di = DiscInfo()
        di.load(first)
        di.dump(second)

        # check if first and second files are identical
        self.assertSameFiles(first, second)
예제 #6
0
    def _test_identity(self, di):
        first = os.path.join(self.tmp_dir, "first")
        second = os.path.join(self.tmp_dir, "second")

        # write original file
        di.dump(first)

        # read file and write it back
        di = DiscInfo()
        di.load(first)
        di.dump(second)

        # check if first and second files are identical
        self.assertSameFiles(first, second)