Ejemplo n.º 1
0
 def test_save_error(self):
     path = tempfile.mkdtemp()
     package_name = ''.join(
         random.choice(string.ascii_lowercase + string.digits)
         for x in range(10))
     non_inited_package = dpm.package.Package()
     non_inited_package.author = 'John Doe'
     non_inited_package = lib.save(non_inited_package)
Ejemplo n.º 2
0
    def test_load(self):
        path = tempfile.mkdtemp()
        package_name = ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(10))

        inited_package = lib.init(path, package_name)
        inited_package.author = 'Jack the Packager'

        inited_package = lib.save(inited_package)

        inited_package = dpm.lib.load(os.path.join(path, inited_package.name))
        assert inited_package.author == 'Jack the Packager'
Ejemplo n.º 3
0
    def test_save(self):
        path = tempfile.mkdtemp()
        package_name = ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(10))

        inited_package = lib.init(path, package_name)
        inited_package.author = 'John Doe'

        inited_package = lib.save(inited_package)
        assert inited_package.installed_path == os.path.join(path, inited_package.name)
        assert inited_package.author == 'John Doe'
        #extra check
        inited_package = dpm.package.Package.load(os.path.join(path, inited_package.name))
        assert inited_package.author == 'John Doe'
Ejemplo n.º 4
0
    def test_load(self):
        path = tempfile.mkdtemp()
        package_name = ''.join(
            random.choice(string.ascii_lowercase + string.digits)
            for x in range(10))

        inited_package = lib.init(path, package_name)
        inited_package.author = 'Jack the Packager'

        inited_package = lib.save(inited_package)

        inited_package = dpm.lib.load(os.path.join(path, inited_package.name))
        assert inited_package.author == 'Jack the Packager'
Ejemplo n.º 5
0
    def test_save(self):
        path = tempfile.mkdtemp()
        package_name = ''.join(
            random.choice(string.ascii_lowercase + string.digits)
            for x in range(10))

        inited_package = lib.init(path, package_name)
        inited_package.author = 'John Doe'

        inited_package = lib.save(inited_package)
        assert inited_package.installed_path == os.path.join(
            path, inited_package.name)
        assert inited_package.author == 'John Doe'
        #extra check
        inited_package = dpm.package.Package.load(
            os.path.join(path, inited_package.name))
        assert inited_package.author == 'John Doe'
Ejemplo n.º 6
0
 def test_save_error(self):
     path = tempfile.mkdtemp()
     package_name = ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(10))
     non_inited_package = dpm.package.Package()
     non_inited_package.author = 'John Doe'
     non_inited_package = lib.save(non_inited_package)