Exemplo n.º 1
0
 def oct10(self):
     client = CkanClient(base_location=self.options.api_url,
                         api_key=self.options.api_key)
     change_licenses = ChangeLicenses(client,
                                      dry_run=self.options.dry_run,
                                      force=self.options.force)
     change_licenses.change_oct_2010(self.options.license_id)
Exemplo n.º 2
0
 def all(self):
     client = CkanClient(base_location=self.options.api_url,
                         api_key=self.options.api_key,
                         http_user=self.options.username,
                         http_pass=self.options.password)
     change_licenses = ChangeLicenses(client,
                                      dry_run=self.options.dry_run,
                                      force=self.options.force)
     change_licenses.change_all_packages(self.options.license_id)
Exemplo n.º 3
0
    def test_1_change_all_pkgs(self):
        if 'sqlite' in config.get('sqlalchemy.url'):
            # Ian thinks this failed for him due to a timestamp not being converted
            # to a datetime object, and being left as a unicode object.
            # Could also be related to Sqlalchemy 0.7.x.
            raise SkipTest

        licenses_before = self.get_licenses()
        self.license_id = 'test-license'
        self.change_licenses = ChangeLicenses(self.testclient)
        self.change_licenses.change_all_packages(self.license_id)
        licenses_after = self.get_licenses()

        change_in_packages = set(licenses_before.keys()) - set(licenses_after.keys())
        assert not change_in_packages, change_in_packages
        for pkg_name in licenses_after.keys():
            assert licenses_after[pkg_name] == self.license_id, licenses_after[pkg_name]
Exemplo n.º 4
0
    def test_1_change_all_pkgs(self):
        # Skip this test until the mock data reflects the new permission model
        # (each dataset *needs* to belong to a group
        raise SkipTest, 'Skip until mock data reflects new permission model'

        if 'sqlite' in config.get('sqlalchemy.url'):
            # Ian thinks this failed for him due to a timestamp not being converted
            # to a datetime object, and being left as a unicode object.
            # Could also be related to Sqlalchemy 0.7.x.
            raise SkipTest

        licenses_before = self.get_licenses()
        self.license_id = 'test-license'
        self.change_licenses = ChangeLicenses(self.testclient)
        self.change_licenses.change_all_packages(self.license_id)
        licenses_after = self.get_licenses()

        change_in_packages = set(licenses_before.keys()) - set(licenses_after.keys())
        assert not change_in_packages, change_in_packages
        for pkg_name in licenses_after.keys():
            assert licenses_after[pkg_name] == self.license_id, licenses_after[pkg_name]